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

Skip to content

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

Merged
merged 4 commits into from
Aug 4, 2011

Conversation

WeatherGod
Copy link
Member

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.

…ogic. Also added the function to the geo, polar, and mplot3d axes with the appropriate return values.

This closes issue matplotlib#110.
@mdboom
Copy link
Member

mdboom commented Jul 14, 2011

Looks good and quite straightforward to me.

@efiring
Copy link
Member

efiring commented Jul 18, 2011

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
Copy link
Member

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"

@WeatherGod
Copy link
Member Author

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

@WeatherGod
Copy link
Member Author

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() :
Copy link
Member

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.

@efiring
Copy link
Member

efiring commented Aug 3, 2011

On 08/03/2011 10:10 AM, WeatherGod wrote:

Ok, I just did some changes to the can_pan() and can_zoom() docs. Do you agree with how I phrased it?

Yes, good. I added a few line notes, and when you have considered
those, go ahead and commit whatever you end up with.

Eric

WeatherGod added a commit that referenced this pull request Aug 4, 2011
Added a "can_pan()" function and included it in the generic panning logic
@WeatherGod WeatherGod merged commit 430788e into matplotlib:master Aug 4, 2011
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.

3 participants