-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Added a "can_pan()" function and included it in the generic panning logic #399
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
Conversation
…ogic. Also added the function to the geo, polar, and mplot3d axes with the appropriate return values. This closes issue matplotlib#110.
Looks good and quite straightforward to me. |
It looks like we are stuck with the confusing situation where "can_zoom" refers only to zoom-to-rect, and "can_pan" refers to either or both of panning and zooming continuously. (The pan/zoom functionality for polar axes is unintuitive to me, and I suspect not very useful.) |
@@ -2781,6 +2781,12 @@ class Axes(martist.Artist): | |||
""" | |||
return True | |||
|
|||
def can_pan(self) : | |||
""" | |||
Return *True* if this axes support the pan action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"support" -> "supports"
"the pan action" -> "any pan/zoom functionality"
You are right, that is confusing, and I don't see how that change to the documentation will help clear things up, either (not that my original doc would be all that clear). |
Ok, I just did some changes to the can_pan() and can_zoom() docs. Do you agree with how I phrased it? |
@@ -2512,7 +2512,8 @@ class NavigationToolbar2(object): | |||
|
|||
self._xypress=[] | |||
for i, a in enumerate(self.canvas.figure.get_axes()): | |||
if x is not None and y is not None and a.in_axes(event) and a.get_navigate(): | |||
if x is not None and y is not None and a.in_axes(event) \ | |||
and a.get_navigate() and a.can_pan() : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stylistic nit: I hate backslash line continuations (they are ugly, and are not wysiwyg) so I would prefer the use of parentheses to allow the expression to span lines.
On 08/03/2011 10:10 AM, WeatherGod wrote:
Yes, good. I added a few line notes, and when you have considered Eric |
Added a "can_pan()" function and included it in the generic panning logic
Added a "can_pan()" function and included it in the generic panning logic. Also added the function to the geo, polar, and mplot3d axes with the appropriate return values.
This closes issue #110.