-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: figimage producing inconsistent results #23399
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
The dpi changes during the lifetime of the figure, so its not surprising that the image changes size. Did you want the |
Thanks, I hadn't considered dpi changes. Including resize=True in the call to figimage doesn't seem to change the behaviour. I am looking for is a reliable way to put a patch of color on the figure -- in my actual code I am not looking for a patch that covers the whole figure, this is just toy code to demonstrate the issue. |
it wouldn't surprise me if figimage has fallen out of repair. I guess someone could fix it, but I'm not a particular fan of the API. If you just want a patch, then just use Patch, and set the transform to fig.transFig. If you want a background image, I'd just make an axes that fills the whole figure ( |
Thanks very much for this, most helpful. |
I think we can re-open. Either the action item is to deprecate figimage or to fix it so at least the resize option works. |
Bug summary
figimage() is producing inconsistent results.
It appears a transform is sometimes applied to the image and sometimes not.
Code for reproduction
Actual outcome
Expected outcome
I would expect all images to look like the png image, i.e. scaled to the figure size.
Additional information
No response
Operating system
Ubuntu 21.10
Matplotlib Version
3.5.0.dev2201+ge9bd017b2d.d20220707
Matplotlib Backend
'QtAgg'
Python version
Python 3.9.7
Jupyter version
No response
Installation
git checkout
The text was updated successfully, but these errors were encountered: