Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
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
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: