On Tue, Oct 2, 2012 at 2:34 PM, Eric Firing <ef...@ha...> wrote:
> On 2012/10/02 8:08 AM, Jianbao Tao wrote:
> > Is it possible to do something like the following to modify the
> > navigation toolbar in matplotlib?
> >
> > 1. Generate a figure window, such as by *fig = figure()*
> > 2. Get a reference of the navigation toolbar, such as by *tbar =
> > fig.get_navigation_toolbar()* or better yet, just by *tbar =
> > fig.navtbar*
> > 3. Modify the toolbar through the reference /tbar/, such as
> > delete/add/edit a button by something like this:
> > *tbar.add_button()*, *tbar.remove_button(a reference to a button)*,
> > *tbar.edit_button(a reference to a button)*.
> > 4. Update the figure by *fig.canvas.draw()*
>
> No, this sort of flexibility has been at least on the mental wish-list
> for a long time, but it is not available. It would require substantial
> work on all of the gui backends.
>
> Eric
>
>
Note, however, code has been improved for the 1.2.0 release to make it
easier to modify the set of buttons that are used. In backend_bases.py,
look for the NavigationToolbar2 class.
Cheers!
Ben Root
|