Open
Description
Bug summary
figimage() is producing inconsistent results.
It appears a transform is sometimes applied to the image and sometimes not.
Code for reproduction
from matplotlib import pyplot
plt = pyplot
import numpy as np
fig = pyplot.figure()
ax = fig.subplots()
fig_bbox = fig.bbox
width, height = fig_bbox.width, fig_bbox.height
img = np.zeros((int(height), int(width), 3))
img += (127, 0, 0)
fig.figimage(img, 0, 0, zorder=-1)
# show the figure, image is not scaled as I would expect
plt.show()
# save as a png, image is scaled as I would expect
fig.savefig('foo.png')
# save as an svg, image matches the one in the FigureCanvas window.
fig.savefig('foo.svg')
# NB reversing the order of the two savefig calls produces images
# matching the FigureCanvas version.
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
Metadata
Metadata
Assignees
Labels
No labels