Re: Pan/Zoom with Matplotlib
- From: Czenek <czenek@xxxxxxxxx>
- Date: Sat, 18 Oct 2008 04:55:05 -0700 (PDT)
On Oct 18, 1:48 am, Czenek <cze...@xxxxxxxxx> wrote:
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
.
- References:
- Pan/Zoom with Matplotlib
- From: Czenek
- Pan/Zoom with Matplotlib
- Prev by Date: Re: loops
- Next by Date: better scheduler with correct sleep times
- Previous by thread: Pan/Zoom with Matplotlib
- Next by thread: Earn 1000$ to 10000$ in Every Month.
- Index(es):
Relevant Pages
|