Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

imshow origin and contour origin behave differently #17046

Open
@anntzer

Description

@anntzer

Bug report

Bug summary

imshow(t, origin="upper") drawst[0, 0] aroundx=0, y=0 on the axes but inverts the y axis to go from top to bottom. On the other hand,contour(t, origin="upper") draws the point corresponding tot[0, 0] atx=0, y=len(t) (modulo off-by-1's that don't matter here), but keeps the axis orientation. So e.g.

t = np.add.outer(np.arange(10)**2, np.arange(10)**2)origin = "upper"plt.imshow(t, origin=origin)plt.contour(t, origin=origin)

(which one may think is necessary to write code that works for both origin="upper" and origin="lower") results in the incorrect
test

At this point I'm not even sure we can really do anything to change that behavior due to backcompat concerns, but at least this could perhaps 1) be documented better in the docstring of contour and 2) be mentioned inhttps://matplotlib.org/tutorials/intermediate/imshow_extent.html? (I haven't even checked howextent interacts with contour origin, but it's probably lots of fun too.)

Matplotlib version

  • Operating system: any
  • Matplotlib version: head
  • Matplotlib backend (print(matplotlib.get_backend())): any
  • Python version: any
  • Jupyter version (if applicable):
  • Other libraries:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp