Named figures support

I am considering a patch to support named figures.

http://sourceforge.net/tracker/?func=detail&aid=3057301&group_id=80706&atid=560723

Tracker: Feature Requests
pls support named figures - ID: 3057301

instead of only:
plt.figure(1)
the following:
plt.figure('today')
would open a figure called 'today' instead of 'figure 1'

Example usage: when opening a lot of tabbed figures (in Spyder) it
would help if the tabs have meaningful names.

I have been successful at modifying pyplot.figure to handle string
arguments. For this I store the figure name in the _label attribute of
the figure in addition to setting the expected plot number value. My
hack seems to works on qt4agg backend (it does requires adding an
optional label argument to the FigureManagerQT constructor).

Is there interest in including such a patch in matplotlib ? Is it
likely to break things elsewhere ?

···

--
thanks,
peter butterworth

That would be a neat feature. Which other backends have you tested? I presume that numbers still work as usual?

Ben Root

···

On Sun, Sep 12, 2010 at 6:54 AM, Peter Butterworth <butterw@…322…9…> wrote:

I am considering a patch to support named figures.

http://sourceforge.net/tracker/?func=detail&aid=3057301&group_id=80706&atid=560723

Tracker: Feature Requests

pls support named figures - ID: 3057301

instead of only:

plt.figure(1)

the following:

plt.figure(‘today’)

would open a figure called ‘today’ instead of ‘figure 1’

Example usage: when opening a lot of tabbed figures (in Spyder) it

would help if the tabs have meaningful names.

I have been successful at modifying pyplot.figure to handle string

arguments. For this I store the figure name in the _label attribute of

the figure in addition to setting the expected plot number value. My

hack seems to works on qt4agg backend (it does requires adding an

optional label argument to the FigureManagerQT constructor).

Is there interest in including such a patch in matplotlib ? Is it

likely to break things elsewhere ?

thanks,

peter butterworth