Pan/Zoom with Matplotlib

C

Czenek

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

Czenek

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top