Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Matplotlib with TKAgg or Qt5Agg backend on 4K screen

I'm using Matplotlib 2.0 with Python 3.6 on Ubuntu 16.04 to create plots of data. The computer monitor is 4k resolution at 3840x2160. Plot figures appear really small with tiny font:

enter image description here

I have tried the TKAgg and Qt5Agg backends for Matplotlib but the figure window still appears small on my 4K display.

Can the backend be configured to scale the figure windows for better viewing on high resolution displays?

like image 342
wigging Avatar asked Nov 08 '22 04:11

wigging


1 Answers

You can tell matplotlib to create a high dpi figure using

plt.figure(dpi=300)

before creating your plot. You can save your plot in higher dpi using:

plt.savefig("figurename.png", dpi=300)
like image 146
Jens Timmerman Avatar answered Nov 14 '22 21:11

Jens Timmerman