Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Initial HiDPI support for qt5agg backend#6389

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

piannucci
Copy link
Contributor

Here's what needs to be done to get HiDPI support working with qt5agg. Not sure if you want to do it this way or some other way.

@tacaswell
Copy link
Member

The changes inqt5_backend.py seem un-related?

@tacaswelltacaswell added this to the2.1 (next point release) milestoneMay 9, 2016
@mretegan
Copy link

On OSX 10.11 I get the following error:

File "/Users/marius/Library/Python/3.5/lib/python/site-packages/matplotlib/backends/backend_qt5.py", line 253, in mouseEventCoords    x,y = self.mouseEventCoords(pos)RecursionError: maximum recursion depth exceeded

@piannucci
Copy link
ContributorAuthor

piannucci commentedMay 13, 2016
edited
Loading

Whoops. I typo'd that pretty badly when building the commit. The changes in the two files are related: if the dpi_ratio is not 1, then mouse events need to be mapped between device and pixel coordinates in order for the rest of the event stack to behave correctly.

Fixed some PEP8 violations.

@fariza
Copy link
Member

Can this be done in a more general way? something that will be useful for all backends?

What about adding aFigureCanvasBase.get_device_pixel_ratio or something like that (returns 1 by default).
And the basic multiplication done in theFigureCanvasBase.xxxEvent instead that in the specific backend?

@astrofrog
Copy link
Contributor

It would be great to get a fix in for this, even if it is not a solution that is applicable to all backends. Currently forglue, everything looks nice and crisp, except the Matplotlib canvas, which looks pixellated (on a retina display).

@adrn
Copy link
Contributor

Any progress on this?@astrofrog are you using the MacOSX backend in the meantime?

@tacaswell
Copy link
Member

@adrn This seems to have stalled. Can you test if this

@tacaswell
Copy link
Member

Sorry for partial message (UI fail: start typing, decide to 'powercycle' to re-trigger CI, close and post partial message)

@adrn Can you test if this works for qt5 + hidpi?

I could be convinced that this should be backported for 2.0 if it gets done in the next week or so.

@tacaswelltacaswell modified the milestones:2.0 (style change major release),2.1 (next point release),2.0.1 (next bug fix release)Aug 28, 2016
@mretegan
Copy link

mretegan commentedAug 30, 2016
edited
Loading

@adrn For applications that embed the Matplotlib window, the MacOSX backend is not an option.

The only standing issue with this is the dpi used in the figure; it is still the default 100, even for Retina display. Maybe this should be scaled by devicePixelRatio? Other than that everything looks really nice and crisp. A print screen of a small app that uses the backend and thecode used to make it. It would be really nice to have this in v2.0.

retina

@jenshnielsen
Copy link
Member

I think we should push for getting this into 2.0. I will see what I can do

@adrn
Copy link
Contributor

@tacaswell I'll also take a look at this today.

@tacaswell
Copy link
Member

@adrn Can you coordinate with@jenshnielsen ?

@jenshnielsen
Copy link
Member

@adrn if you have time to work on it that is much appreciated, I will then make sure it is reviewed and merged.

adrn reacted with thumbs up emoji

@adrn
Copy link
Contributor

@jenshnielsen Will try -- I'm atastrohackweek and will likely spend some hack time on this.

@jenshnielsen
Copy link
Member

Great if you need any assistance please just ask

@adrn
Copy link
Contributor

Alright here's what I see. I compares (this PR + qt5agg) and (this PR + tkagg) using this code:

importnumpyasnpimportmatplotlibasmpl# mpl.rcParams['backend'] = 'tkagg'# mpl.rcParams['backend'] = 'qt5agg'importmatplotlib.pyplotaspltwithplt.style.context('classic'):x=np.random.normal(size=128)y=np.random.normal(size=128)plt.scatter(x,y)plt.show()

qt5agg

tkagg

So it looks like the fix here works, but the fonts, markers, ticks, etc. need to be scaled by the pixel ratio?

@tacaswell
Copy link
Member

I think you just need to up the DPI passed to the renderer?

@jenshnielsen
Copy link
Member

#5383 which adds hidpi support to the notebook backend may give you some clues on how to do that.

@QuLogicQuLogic mentioned this pull requestNov 24, 2016
@QuLogic
Copy link
Member

Finished in#7507.

@QuLogicQuLogic closed thisJan 4, 2017
@QuLogicQuLogic modified the milestones:2.0 (style change major release),2.0.1 (next bug fix release)Jan 4, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@QuLogicQuLogic

Projects
None yet
Milestone
v2.0.0
Development

Successfully merging this pull request may close these issues.

9 participants
@piannucci@tacaswell@mretegan@fariza@astrofrog@adrn@jenshnielsen@QuLogic@mdboom

[8]ページ先頭

©2009-2025 Movatter.jp