Navigation toolbar w/o subplot configuration button

Hello,

I'm using mpl in a wxPython application to display plots dynamically. I want
to let the users interact with the plots (zoom, move), but I don't need the
"subplot configuration" button on the Navigation Toolbar. Can I instantiate
the toolbar without this button ?

TIA
Eli

···

--
View this message in context: http://www.nabble.com/Navigation-toolbar-w-o-subplot-configuration-button-tp18747977p18747977.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Yes. I did this by deriving my toolbar class from the default NavigationToolbar2WxAgg. Then deleting the buttons I did not want. I had to delete by position, because I did not know their IDs. (Does anyone know how to get the IDs of these standard buttons?) Sample code below:

class VMToolbar(NavigationToolbar2WxAgg):

    def __init__(self, plotCanvas):
        NavigationToolbar2WxAgg.__init__(self, plotCanvas)

        # delete unwanted tools
        self.DeleteToolByPos(1) # Back Arrow
        self.DeleteToolByPos(1) # Forward Arrow (note this was position 2)
        self.DeleteToolByPos(3) # Divider (this was position 5)
        self.DeleteToolByPos(3) # Configure subplots (this was position 6)
         ...
    #end __init__
#end class

···

-----Original Message-----
From: matplotlib-users-bounces@lists.sourceforge.net [mailto:matplotlib-users-bounces@lists.sourceforge.net] On Behalf Of eliben
Sent: Thursday, July 31, 2008 1:28 AM
To: matplotlib-users@lists.sourceforge.net
Subject: [Matplotlib-users] Navigation toolbar w/o subplot configuration button

Hello,

I'm using mpl in a wxPython application to display plots dynamically. I want
to let the users interact with the plots (zoom, move), but I don't need the
"subplot configuration" button on the Navigation Toolbar. Can I instantiate
the toolbar without this button ?

TIA
Eli

--
View this message in context: http://www.nabble.com/Navigation-toolbar-w-o-subplot-configuration-button-tp18747977p18747977.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Alternatively, you can follow the lead of
examples/user_interfaces/embedding_in_wx4.py which uses a custom
toolbar. You can cut the NavigationToolbar2 code from backend_wx.py
and remove the bits you don't want.

JDH

···

On Thu, Jul 31, 2008 at 8:18 AM, Ben Axelrod <baxelrod@...2066...> wrote:

Yes. I did this by deriving my toolbar class from the default NavigationToolbar2WxAgg. Then deleting the buttons I did not want. I had to delete by position, because I did not know their IDs. (Does anyone know how to get the IDs of these standard buttons?) Sample code below: