469,929 Members | 1,889 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

Pan/Zoom with Matplotlib

Hi,
can I use somehow standard matplotlib's functions pan/zoom? I would
like to zoom my created graph after double-clicking and move with it
after keyboard (arrow) pressing (similar as Google Maps). And I want
also to control how much it zooms and how far is the graph moved after
pressing a key (or double-clicking).
So are there any appropriate API functions which can be connected with
keyboard and mouse events?

Thanks
Czenek

PS: I'd like to use it with tk.
Oct 17 '08 #1
1 4287

On Oct 18, 1:48*am, Czenek <cze...@gmail.comwrote:
Hi,
can I use somehow standard matplotlib's functions pan/zoom? I would
like to zoom my created graph after double-clicking and move with it
after keyboard (arrow) pressing (similar as Google Maps). And I want
also to control how much it zooms and how far is the graph moved after
pressing a key (or double-clicking).
So are there any appropriate API functions which can be connected with
keyboard and mouse events?

Thanks
Czenek

PS: I'd like to use it with tk.


And

import matplotlib as mpl
f=mpl.figure(figsize(5,5),dpi=100)
sbplt=f.add_subplot(111)

....

while 1:
x1,x2=sbplt.get_xlim()
y1,y2=sbplt.get_ylim()
sbplt.set_xlim(x1+0.1,x2+0.1)
sbplt.set_ylim(y1+0.1,y2+0.1)
f.canvas.draw()
this works pretty well on Linux, but the movement on Windows is slow
and therefore it is not smooth.

Any advice for better smoothness?

Czenek
Oct 18 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by John Hunter | last post: by
3 posts views Thread by John Hunter | last post: by
2 posts views Thread by Grant Edwards | last post: by
reply views Thread by spross | last post: by
reply views Thread by Soren | last post: by
4 posts views Thread by Bill Jackson | last post: by
4 posts views Thread by John Henry | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.