[Matplotlib-users] saving animations

2010-08-24 Thread David Pine
I am trying to save the frames from a matplotlib animation and I have a question that is undoubtedly based on a profound lack of understanding about how matplotlib/python works, but I'm hoping someone can offer me an explanation. The following code is excerpted from the animation examples "ani

Re: [Matplotlib-users] legend missed one dataset

2010-08-24 Thread Michael Droettboom
You have plotted three lines, but only provided legend labels for two of them. Try: plt.legend(('Model length', 'Data length', 'Something else'), 'best', shadow=True, fancybox=True) Mike On 08/24/2010 06:33 AM, xyz wrote: > Hello, > the following script creates a legend for only

[Matplotlib-users] legend missed one dataset

2010-08-24 Thread xyz
Hello, the following script creates a legend for only two instead of three datasets. --- from pylab import * import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) for i in [[2,2], [2,3], [4.2,3.5]]: print i[0],i[1] plt.plot(i[0],i[1],'o') ax.grid(True) plt.l

Re: [Matplotlib-users] a question about backend, matplotlib and ipython

2010-08-24 Thread xiaoni
Hello, Benjamin, Thanks for your quick response ! I found that I only need use clf(), and then everything is fine ! The code can be run quickly and I can exit ipython gracefully afterwards. So it is not a problem of backend, just of clearing the existing figures properly ! (close() is not go