What is the most effective approach to perform a 'zoom under mouse cursor'? Currently I use the following code (considering g as mpl.Axes), but set_xlim() is called twice. Is there a better approach?
<code> # First zoom result = \ g.bbox.shrunk(DEFAULT_ZOOM_FACTOR,1).transformed(g.transData.inverted()) g.set_xlim(*result.intervalx) # Get the new location of initial event b = g.transData.transform_point([event.xdata, 0]) # Then replace the original location under the mouse cursor result = \ g.bbox.translated(-(event.x-b[0]),0).transformed(g.transData.inverted()) g.set_xlim(*result.intervalx) </code> Arnaud. ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users