Skip to content

Why not get the same clear image on a high-resolution screen? #10235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
reaCodes opened this issue Jan 12, 2018 · 9 comments
Closed

Why not get the same clear image on a high-resolution screen? #10235

reaCodes opened this issue Jan 12, 2018 · 9 comments
Assignees
Milestone

Comments

@reaCodes
Copy link

My screen resolution is 2k, dpi zoom 200%

For example:

This is the picture displayed after running
image

And this is an image saved with dpi = 300
image

My point is that gui applications are not ideal for displaying on high-resolution screens.

@tacaswell
Copy link
Member

what version of Matplotlib, what backend, and what OS?

@reaCodes
Copy link
Author

@tacaswell Matplotlib: 2.1.1, Python: 3.6.4, OS: Windows 10 16299

image

Not only pictures, but also the toolbar is not clear.

image

Can you tell the difference? The second picture is much cleaner, with dpi = 300

@anntzer
Copy link
Contributor

anntzer commented Jan 12, 2018

Can you try with qt5agg instead of tkagg? (add import matplotlib; matplotlib.use("qt5agg") at the very top of your script; you may need to install pyqt5 from conda or pypi.)

@dstansby
Copy link
Member

@reaCodes is this still an issue? Did you get a chance to try out @anntzer's suggestion?

@timhoffm
Copy link
Member

timhoffm commented Nov 5, 2019

On master: tkagg is blurry. qt5agg is sharp (150%, 200% tested). Holds for icons and plot itself.

@anntzer
Copy link
Contributor

anntzer commented Nov 6, 2019

I think this is essentially a duplicate of #10388. Even though this issue was opened first I'll close it as there is more discussion on the other.
Feel free to reopen if you think a separate issue is warranted.

Actually let's keep this open for discussing the Windows case because the solution is likely OS-specific...

@anntzer
Copy link
Contributor

anntzer commented Nov 6, 2019

@timhoffm (or anyone else, for that matter) If you have a high-dpi screen available to testing on Windows, can you try calling one of https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setprocessdpiaware https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setprocessdpiawarenesscontext in tkagg.cpp? (e.g. at the top of PyInit__tkagg)
(also https://bugs.python.org/issue33656 suggests how to do this with ctypes)

@anntzer anntzer reopened this Nov 6, 2019
@timhoffm
Copy link
Member

timhoffm commented Nov 6, 2019

@anntzer will do some time later this week.

@QuLogic
Copy link
Member

QuLogic commented Jul 8, 2021

Support for HiDPI in TkAgg on Windows was added in #19167.

@QuLogic QuLogic closed this as completed Jul 8, 2021
@QuLogic QuLogic added this to the v3.5.0 milestone Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants