Custom pan button

I have been working on a GUI application which uses matplotlib as a wx object. I'd like to include a pan button on the toolbar of the application but can't seem to get an axes object which has the pan functions (which I'd like to use to tie into the pan code). I have a self.axes object that identifies itself as <matplotlib.axes.Subplot instance...> which I use to add lines, set limits, etc but it doesn't have any of the pan functions (start_pan, end_pan, etc). self.canvas.figure.get_axes() (which is what seems to be used in the NavigationToolbar2 class) returns the same Subplot instance. Any suggestions of how to get a axes/Subplot instance which has the pan functions?

Thanks,
-Jonathan Helmus

Sorry folks, I found my own problem. Looks like the axes pan functions were a recent addition to matplotlib and the version I'm using, 0.91.2, doesn't have these. Time to bug the system admin to update to the 0.98 version.

-Jonathan Helmus

Jonathan Helmus wrote:

···

I have been working on a GUI application which uses matplotlib as a wx object. I'd like to include a pan button on the toolbar of the application but can't seem to get an axes object which has the pan functions (which I'd like to use to tie into the pan code). I have a self.axes object that identifies itself as <matplotlib.axes.Subplot instance...> which I use to add lines, set limits, etc but it doesn't have any of the pan functions (start_pan, end_pan, etc). self.canvas.figure.get_axes() (which is what seems to be used in the NavigationToolbar2 class) returns the same Subplot instance. Any suggestions of how to get a axes/Subplot instance which has the pan functions?

Thanks,
-Jonathan Helmus

[snip]

instance...> which I use to add lines, set limits, etc but it doesn't
have any of the pan functions (start_pan, end_pan, etc).
self.canvas.figure.get_axes() (which is what seems to be used in the
NavigationToolbar2 class) returns the same Subplot instance. Any
suggestions of how to get a axes/Subplot instance which has the pan
functions?

Hi Jonathan,

On earlier versions of Matplotlib, you can use the NavigationToolbar2
class without actually displaying it (the toolbar) in your program.
Instead you can use your custom buttons, keypresses, etc, to tie into
the class' methods. We've done that with our app, and it works quite
nicely. In fact, you can borrow the bits you need from that class to
create your own zoom/pan routines.

Cheers,
Anthony.

···

On Mon, Aug 11, 2008 at 1:31 PM, Jonathan Helmus <jjhelmus@...287...> wrote: