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
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
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
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