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

Skip to content

Add scale(x)(y) parameter(s) to imshow as in plot #18970

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

Closed
alexiscoutinho opened this issue Nov 18, 2020 · 4 comments · May be fixed by #15595
Closed

Add scale(x)(y) parameter(s) to imshow as in plot #18970

alexiscoutinho opened this issue Nov 18, 2020 · 4 comments · May be fixed by #15595
Labels
New feature status: inactive Marked by the “Stale” Github Action

Comments

@alexiscoutinho
Copy link
Contributor

Problem

In situations where an Axes has a large background image/map (extent greater than axis limits) and the axis limits are supposed to be controlled by other artists, like paths, it would be very helpful to have toggling parameters like scalex and scaley as in Axes.plot. Right now, even if you fix the limits after imshow, the moment you let autoscale do its thing (which is desired) it rescales to show the whole image.

Proposed Solution

A very simple and probably naive solution would be to wrap the imshow line below in an if where scalexy is True by default:

if scalexy:
    im.set_extent(im.get_extent())
@anntzer
Copy link
Contributor

anntzer commented Nov 18, 2020

I think that's basically #15595 (more or less...)?

@alexiscoutinho
Copy link
Contributor Author

Yes.

@QuLogic QuLogic linked a pull request Nov 19, 2020 that will close this issue
6 tasks
@github-actions
Copy link

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 Sep 15, 2023
@timhoffm
Copy link
Member

I close this in favor of #15595. It's better to have this as an Artist property rather than putting explicit scalex/scaley parameters in all kinds of plot functions.

@timhoffm timhoffm closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New feature status: inactive Marked by the “Stale” Github Action
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants