Skip to content

Allow invalid limits when panning #9363

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
Oct 23, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Ignore invalid limits in pan.
  • Loading branch information
anntzer committed Oct 12, 2017
commit b848e8a88b7bfcc354a18b9a01e92da2b80cc568
8 changes: 6 additions & 2 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3830,8 +3830,12 @@ def format_deltas(key, dx, dy):
warnings.warn('Overflow while panning')
return

self.set_xlim(*result.intervalx)
self.set_ylim(*result.intervaly)
valid = np.isfinite(result.transformed(p.trans))
points = result.get_points().astype(object)
# Just ignore invalid limits (typically, underflow in log-scale).
points[~valid] = None
self.set_xlim(points[:, 0])
self.set_ylim(points[:, 1])

@cbook.deprecated("2.1")
def get_cursor_props(self):
Expand Down