On Mon, Sep 15, 2008 at 1:51 PM, Mathieu Dubois <mathieu.dubois@...> wrote:
> I'm a (still) beginner in scipy and I have a small problem with figures.
> Let me
> I have to plot a lot of huge data so I have a lot of figures. I have set
> title and axes names. All the handles are in a list (the list can vary
> at run time according to the user input).
> My goal is to save the figures (with savefig()). For this I want to
> write a loop which look like this:
> for fig in fig_list
> figure(fig) # Select current figure
> savefig('%s.png' % fig.title, format='png') # Save it as 'title'.png
> The problem is well explained in a previous message:
> but nobody has answered to this post.
The matplotlib figure is contained in a FigureCanvas which is
contained in a FigureManager, and the manager has a method to set the
unfortunately, there is no method provided to *get* the window title
for reuse later by savefig (we need to add it). You can, however, use
the figure label (all matplotlib artists from lines, to text, to the
axes to the figure have a label property. So something like this
import matplotlib.pyplot as plt
fig = plt.figure()
title = 'some title'
Hope this helps,