X Tutup
Skip to content

Funny things happen when a rectangle with negative width/height is passed to axes() #7487

@anntzer

Description

@anntzer

mpl 2.0b4

axes([.9, .9, -.8, -.8]); plot([1, 2])

negative-axes

Interative zooming seems to work but fails to draw the rubber-band; I suspect it is because the implementation of drag_zoom assumes that the axes' bbox extents are in the "standard" order:

            x1, y1, x2, y2 = a.bbox.extents
            x, lastx = max(min(x, lastx), x1), min(max(x, lastx), x2) # probably happens here
            y, lasty = max(min(y, lasty), y1), min(max(y, lasty), y2)

(and I'd guess there may be other issues elsewhere).

Not sure whether we want to do something about it (which may be as simple as reordering the bbox extents in the Axes constructor, or raising an exception if the width or height are negative), or just document that this is not supported and live with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: consistencyDifficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup