Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Changes from1 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
NextNext commit
Minor cleanups to Axes._drag_pan.
  • Loading branch information
@anntzer
anntzer committedOct 11, 2017
commit2d9fded786056fcb9bc6e50c727a74c7748a2397
17 changes: 7 additions & 10 deletionslib/matplotlib/axes/_base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3803,7 +3803,7 @@ def format_deltas(key, dx, dy):
dy = dy / abs(dy) * abs(dx)
else:
dx = dx / abs(dx) * abs(dy)
return(dx, dy)
return dx, dy

p = self._pan_start
dx = x - p.x
Expand All@@ -3812,23 +3812,20 @@ def format_deltas(key, dx, dy):
return
if button == 1:
dx, dy = format_deltas(key, dx, dy)
result = p.bbox.translated(-dx, -dy) \
.transformed(p.trans_inverse)
result = p.bbox.translated(-dx, -dy).transformed(p.trans_inverse)
elif button == 3:
try:
dx = -dx /float(self.bbox.width)
dy = -dy /float(self.bbox.height)
dx = -dx / self.bbox.width
dy = -dy / self.bbox.height
dx, dy = format_deltas(key, dx, dy)
if self.get_aspect() != 'auto':
dx = 0.5 * (dx + dy)
dy = dx

dx = dy = 0.5 * (dx + dy)
alpha = np.power(10.0, (dx, dy))
start = np.array([p.x, p.y])
oldpoints = p.lim.transformed(p.trans)
newpoints = start + alpha * (oldpoints - start)
result = mtransforms.Bbox(newpoints) \
.transformed(p.trans_inverse)
result =(mtransforms.Bbox(newpoints)
.transformed(p.trans_inverse))
except OverflowError:
warnings.warn('Overflow while panning')
return
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp