|
From: Andre' Walker-L. <wal...@gm...> - 2012-06-21 22:01:52
|
Hi Tony, > Unfortunately, I think the preferred method is to create a proxy artist: > > http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist > > Basically, you draw a fake patch with the same parameters as your fill (see example below). > > Hope that helps, Yes, that helps. I also found another simple way using matplotlib.pyplot.bar() === import numpy as np import matplotlib.pyplot as plt x = np.array([1,2]) data = np.array([10,8]) err = np.array([2,1]) b1 = plt.bar(x-.2,2*err,0.4,color='b',bottom=data - err,alpha=0.3) plt.legend([b1[0]], ['nice legend graphic'],shadow=True,fancybox=True,numpoints=1) plt.axis([0,3,0,15]) plt.show() === Thanks, Andre |