Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

imshow() should not modify axes aspect if transform != ax.transData. #14118

Copy link
Copy link
Closed
@anntzer

Description

@anntzer
Issue body actions

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
timhoffm

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.Issues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github ActionMarked by the “Stale” Github Actiontopic: images

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.