Pan/Zoom with Matplotlib

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Czenek

    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.
  • Czenek

    #2
    Re: Pan/Zoom with Matplotlib


    On Oct 18, 1:48 am, Czenek <cze...@gmail.c omwrote:
    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(fi gsize(5,5),dpi= 100)
    sbplt=f.add_sub plot(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

    Comment

    Working...