8000 Cleanup of merged pylab examples by QuLogic · Pull Request #8677 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Cleanup of merged pylab examples #8677

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 5 commits into from
May 31, 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
Next Next commit
Allow wraparound in image slice viewer example.
Also, drop the more expensive `np.clip` call.
  • Loading branch information
QuLogic committed May 29, 2017
commit 4df2bb7e28bf5abf8e88064c0fa8625b0743900f
4 changes: 2 additions & 2 deletions examples/animation/image_slices_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def __init__(self, ax, X):
def onscroll(self, event):
print("%s %s" % (event.button, event.step))
if event.button == 'up':
self.ind = np.clip(self.ind + 1, 0, self.slices - 1)
self.ind = (self.ind + 1) % self.slices
else:
self.ind = np.clip(self.ind - 1, 0, self.slices - 1)
self.ind = (self.ind - 1) % self.slices
self.update()

def update(self):
Expand Down
0