I am trying to plot a line area graph similar to a stacked bar chart.
E.g
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111)
ind = np.arange(3)
y1 = np.array([1,2,3])
y2 = y1 * 2
a = ax.fill_between(ind, y1, np.zeros(len(ind)), facecolor='r')
b = ax.fill_between(ind, y2, y1, facecolor='b')
plt.show()
However, when I try to make my legend,
ax.legend((a,b),('a','b'))
I get an AttributeError. How do I extract the information I need from the
PolyCollection object to make a legend?
Thanks,
- Chuck
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users