8000 Add scale(x)(y) parameter(s) to imshow as in plot · Issue #18970 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Add scale(x)(y) parameter(s) to imshow as in plot #18970
Closed as not planned
@alexiscoutinho

Description

@alexiscoutinho

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())

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0