Thanks to visit codestin.com
Credit goes to github.com

Skip to content

NonUniformImage class needs Axes method and pyplot function #7763

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

Open
efiring opened this issue Jan 7, 2017 · 8 comments
Open

NonUniformImage class needs Axes method and pyplot function #7763

efiring opened this issue Jan 7, 2017 · 8 comments
Labels
Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues keep Items to be ignored by the “Stale” Github Action New feature

Comments

@efiring
Copy link
Member

efiring commented Jan 7, 2017

The NonUniformImage class in image.py is potentially a good match for many use cases, but it is rarely used because it's high-level API is missing. It should be as accessible as imshow and pcolormesh.

@efiring efiring added Difficulty: Easy https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues new-contributor-friendly New feature labels Jan 7, 2017
@efiring efiring added this to the 2.2 (next next feature release) milestone Jan 7, 2017
@anntzer
Copy link
Contributor

anntzer commented Jan 9, 2017

NonUniformImage ultimately relies on pcolor (see NonUniformImage.make_image), which is available in pyplot; is pcolor not sufficient for these purposes?

@efiring
Copy link
Member Author

efiring commented Jan 9, 2017

pyplot.pcolor does not use _image.pcolor; it makes a PolyCollection.

@anntzer
Copy link
Contributor

anntzer commented Jan 9, 2017

Interesting... Perhaps we should rename _image.pcolor to avoid the confusion? :-)

pcolorfast (which only exists as a method on the Axes class, not in pyplot) does propose an option to use PcolorImage, which relies ultimately on _image.pcolor2. Do you know the difference between _image.pcolor and image.pcolor2? Would exposing pcolorfast (perhaps under another name and with a slightly improved API) be enough?

@efiring
Copy link
Member Author

efiring commented Jan 9, 2017

The difference is that _image.pcolor2 colors rectangles specified by their edges; image.pcolor takes rectangle centers, and includes an option for bilinear interpolation. Yes, the naming is confusing. Exposing pcolorfast, and/or the part of it that uses pcolor2, is probably overdue, but it is not a substitute for NonUniformImage, which is also in need of better exposure.

There is plenty of scope for improvements in this whole area, including factoring more chunks of related functionality out of _axes.py.

@efiring
Copy link
Member Author

efiring commented Jan 9, 2017

Actually, I don't think the bilinear interpolation option in NonUniformImage is such a great idea. Without that, I think _image.pcolor could be dumped and everything could be done with pcolor2. NonUniformImage would just add an initial step, which could be at the python level, to make an edge grid based on the user's center grid.

I originally wrote pcolorfast because I use this type of plot quite a bit, often with an irregular rectangular grid. I hacked pcolor2 out of _image.pcolor.

@anntzer
Copy link
Contributor

anntzer commented Jan 9, 2017

Perhaps remove the new-contributor-friendly tag? I don't think it's hard but this apparently needs some nontrivial API discussions. (Anyways, add it back if you disagree.)

@github-actions
Copy link

github-actions bot commented Apr 5, 2023

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Apr 5, 2023
@tacaswell tacaswell added Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues and removed Difficulty: Easy https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues labels Apr 5, 2023
@tacaswell
Copy link
Member

Still open, still a good idea, and technically very easy, but changed level to medium due to the API discussions that will need to be had.

@QuLogic QuLogic removed the status: inactive Marked by the “Stale” Github Action label Apr 5, 2023
@oscargus oscargus added the keep Items to be ignored by the “Stale” Github Action label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues keep Items to be ignored by the “Stale” Github Action New feature
Projects
None yet
Development

No branches or pull requests

5 participants