Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No pcolormesh referenced #55

Open
jklymak opened this issue Mar 14, 2021 · 5 comments
Open

No pcolormesh referenced #55

jklymak opened this issue Mar 14, 2021 · 5 comments

Comments

@jklymak
Copy link
Member

jklymak commented Mar 14, 2021

Folks should be usingpcolormesh in general rather than imshow - imshow really only works for equally spaced pixels, and there is lots of data that is not laid out that way. However the cheatsheet doesn't mention pcolormesh.

@rougier
Copy link
Member

rougier commented Mar 17, 2021

Cheatsheets are meant to give a quick overview of the main functions and I had to make some choices. Regarding pcolormesh and imshow, I don't know if we have usage statistics but from the gallery, I think there are mostly examples using imshow and not so many using pcolormesh. But I may be wrong.

@jklymak
Copy link
Member Author

jklymak commented Mar 17, 2021

I wouldn't suggest pcolormesh instead of imshow. Perhaps pcolormesh instead of xcorr? xcorr is just a light wrapper around np.correlate and stem.

The point of pcolormesh is that it works properly with unequally spaced x and y. If someone mistakenly uses imshow in that circumstance, their image will be off. imshow also lays things out upside down unless you are explicitly looking at an image. Finally it has the wacky "extent" kwargs which interact so strangely with the limits and the "origin" kwarg that we have to have a whole "intermediate" tutorial to explain it (https://matplotlib.org/stable/tutorials/intermediate/imshow_extent.html)... Of course, the way we implement pcolormesh has its quirks as well ;-)

@rougier
Copy link
Member

rougier commented Mar 17, 2021

I would need to think of an illustrative usage case. From the galley, I found only one.

@jklymak
Copy link
Member Author

jklymak commented Mar 17, 2021

I used the same data that you used for contour in both imshow and pcolormesh. For the pcolormesh, I made dx vary in the x vector, just to show that was possible:

https://github.com/matplotlib/matplotlib/pull/19703/files

@rougier
Copy link
Member

rougier commented Mar 19, 2021

Can't we used a logspace for X and Y with the "default" imshow pattern ? That would be a nice use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants