Skip to content

[ENH]: Remove +/- 45deg restriction on rotating RectangleSelector #21937

Open

Description

@dstansby

Problem

There's currently a restriction to +/- 45deg for rotating a RectangleSelector. See #20839 (comment) and #20839 (comment) for some previous discussion/context.

I think it is technically possible to remove this restriction, and am currently looking into it.

Proposed solution

No response

Activity

  1. dhomeier commented on Dec 13, 2021

    @dhomeier

    See also #21886 (comment) for discussion of the "correct" assignment of handle labels.
    Put it somewhat differently, to what extent should an "original" version of a shape be preserved? For Rectangle/Ellipse any rotation can already be effected by its angle modulo 90˚plus possibly swapping long and short axes, so self.rotation could remain restricted to that range (or equivalently ±45˚), and width/height be exchanged as required. I am still in favour of allowing larger rotation angle changes in one event, just the properties would be updated afterwards.
    Somewhat related, when rotation support for PolygonSelector is added at some point, a rotated polygon can always be substituted by another polygon with rotated vertices, so that case might be implemented without bothering to ever keep track of the rotation angle.

  2. dstansby commented on Dec 13, 2021

    @dstansby
    MemberAuthor

    I've just spend a little time working on this, so thought I would share my approach. I think the fundamental limitation is that RectangleSelector is implemented in data coordinates, whereas selectors really work in display coordinates. When we rotate a selector, we want the rotation to happen in display space, not data space.

    So I'm working to change RectangleSelector to be defined in display space. This is going to be a major change, but will make operations like scaling and rotating much easier by applying them in the native display coordinates that the user is interacting with.

  3. github-actions commented on Nov 14, 2025

    @github-actions

    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!

  4. timhoffm commented on Nov 14, 2025

    @timhoffm
    Member

    #26833 will address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions