Closed
Description
Bug report
Bug summary
AxesImage.__str__
is currently implemented as "AxesImage(%g,%g;%gx%g)" % tuple(self.axes.bbox.bounds)
, which means that the coordinates printed out are wrong whenever the image does not span the full Axes. (Well, technically we make no guarantees about the meaning of the str
of the image but you'd expect that the numbers match the image's extents...
Code for reproduction
from pylab import *
im1 = imshow([[1, 2]]); im2 = imshow(np.arange(9).reshape((3, 3))); print(im1, im2)
Actual outcome
One image is much smaller than the other, but both are printed as
AxesImage(80,52.8;496x369.6) AxesImage(80,52.8;496x369.6)
Expected outcome
Either correct extents, or a different __str__
with less information.
Matplotlib version
- Operating system: linux
- Matplotlib version (
import matplotlib; print(matplotlib.__version__)
): 3.4+HEAD - Matplotlib backend (
print(matplotlib.get_backend())
): any - Python version: 39
- Jupyter version (if applicable):
- Other libraries: