Skip to content

[MNT]: Should set_size_inches be updated to use device_pixel_ratio? #21090

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
anntzer opened this issue Sep 16, 2021 · 1 comment
Closed

[MNT]: Should set_size_inches be updated to use device_pixel_ratio? #21090

anntzer opened this issue Sep 16, 2021 · 1 comment
Milestone

Comments

@anntzer
Copy link
Contributor

anntzer commented Sep 16, 2021

Summary

set_size_inches currently uses

dpi_ratio = getattr(canvas, '_dpi_ratio', 1)

I haven't actually tried, but I wonder if that was missed in #19126, and should be changed to canvas.device_pixel_ratio?

(Likewise, backend_macosx.py would likely need to be updated in the same manner?)

Proposed fix

No response

@QuLogic
Copy link
Member

QuLogic commented Sep 28, 2021

It does appear to be wrong. The figure is double-sized for what was requested, if you pull it from a hidpi back to regular screen.

QuLogic added a commit to QuLogic/matplotlib that referenced this issue Sep 28, 2021
This passes physical pixels to the backend, as it will be more accurate
due to the int-cast.

Fixes matplotlib#21090
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Sep 29, 2021
This passes physical pixels to the backend, as it will be more accurate
due to the int-cast.

Fixes matplotlib#21090
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Sep 29, 2021
This passes physical pixels to the backend, as it will be more accurate
due to the int-cast.

Fixes matplotlib#21090
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Sep 29, 2021
This passes physical pixels to the backend, as it will be more accurate
due to the int-cast.

Fixes matplotlib#21090
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Oct 15, 2021
This passes physical pixels to the backend, as it will be more accurate
due to the int-cast.

Fixes matplotlib#21090
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Oct 15, 2021
This passes physical pixels to the backend, as it will be more accurate
due to the int-cast.

Fixes matplotlib#21090
@QuLogic QuLogic added this to the v3.5.0 milestone Oct 20, 2021
ccaprani pushed a commit to ccaprani/matplotlib that referenced this issue Jan 23, 2023
This passes physical pixels to the backend, as it will be more accurate
due to the int-cast.

Fixes matplotlib#21090
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

2 participants