Description
Currently, imshow() automatically updates the axes aspect via the aspect
kwarg; its default, None, means rcParams["image.aspect"]
, which is "equal" by default (i.e., square image pixels).
If the transform
kwarg is also passed, and set to something else[1] than ax.transData
(the default), then setting the aspect is clearly not useful (the image is not going to be drawn in data coordinates so it should not affect the relative size of x- and y-data). In that case, the default of aspect=None
should just mean "don't modify the aspect".
[1] Really, this should be "something that does not contains transData as a branch", as in #13642.
The current behavior is the reason why #14057 and #14117 need to explicitly set the aspect to "auto" in or after the last imshow() call (otherwise, some head-scratching occurs).
On the other hand, making this change would once again lead to some seriously non-obvious interaction between parameters (the meaning of aspect=None
depends on the value of transform
), which I'm not sure is great either :/
Matplotlib version
- Operating system: linux
- Matplotlib version: master/any
- Matplotlib backend (
print(matplotlib.get_backend())
): qt5agg - Python version: 37