-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: Rasterized Artists in DrawingArea
will be misplaced in the vectorized backend
#28549
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
Comments
Is there any follow up on this behavior? |
I suspect HiDPI is messing in the positioning, but no time to investigate. |
I tested on v3.7.1. The results are still the same. |
Presumably DrawingArea does not deal with dpi changes properly. Someone who uses DrawingArea would need to chase down why this is broken. |
I am also having issues with rasterized graphics rendering in the incorrect position when saving to pdf. Notably, setting the dpi to 72 as in #10844 corrects the positioning issue. My situation does not include Drawing Area but includes rasterized artists, patches, gridspec, an inset axis, and annotations. When using a dpi other than 72 the axes, patches, and annotations appear as they should but the rasterized artists are scaled incorrectly. The higher the dpi the smaller the rasterized artists appear in the lower left hand corner. Matplotlib version 3.9.1 Edit: removing bbox_inches='tight' solves my issue |
It looks like @mjfield2 your issue looks more similar to #27763, which is fixed ready for v3.11. If you want to check whether your case is fixed, you can install a nightly build. If it isn't please feel free to open a new issue with the details (though note we are aware of a remaining small offset with |
Bug summary
If I rasterized artists in
DrawingArea
, they are rendered correctly in rasterized backend but will be misplaced in the vectorized backendCode for reproduction
Actual outcome
When set

rasterized=True
and in backendsvg
orpdf
:In other situations, it's properly render:

Expected outcome
This is expected in any situation:

Additional information
No response
Operating system
OS/X arm
Matplotlib Version
3.9.1
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
3.10.13
Jupyter version
4.1.1
Installation
pip
The text was updated successfully, but these errors were encountered: