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

Skip to content

RectangleSelector: Handle case when button is still pressed when mouse is not in the axis #658

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

Merged
merged 2 commits into from
Feb 26, 2012

Conversation

agardelein
Copy link
Contributor

For the user, it is more convenient to have the RectangleSelector still responsive when not in the axis. However the selection is limited to the axis boundaries.

@mdboom
Copy link
Member

mdboom commented Jan 6, 2012

+1. This looks good to me. I'm going to leave this up for others to experiment with for a while before merging.

@agardelein
Copy link
Contributor Author

RectangleSelector and SpanSelector have a 'visible' property used directly into Rectangle. In RectangleSelector has also an additional property 'active' which is only used in ignore(). Why SpanSelector does not do the same ?

if event.button == self.eventpress.button and event.inaxes != self.ax:
(xdata, ydata) = self.ax.transData.inverted().transform_point((event.x, event.y))
xlim = self.ax.get_xlim()
ylim = self.ax.get_ylim()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to use self.ax.get_xbound() etc. in place of get_xlim() in case the axis is inverted.

@jdh2358 jdh2358 closed this Feb 26, 2012
@jdh2358 jdh2358 reopened this Feb 26, 2012
jdh2358 added a commit that referenced this pull request Feb 26, 2012
RectangleSelector: Handle case when button is still pressed when mouse is not in the axis
@jdh2358 jdh2358 merged commit ec0d33d into matplotlib:master Feb 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants