"Ed Schofield" <[EMAIL PROTECTED]> writes: > If I plot a legend as below, the colours in both legend entries are > the same. Am I doing something wrong?
> pylab.hist(data1, normed=True, alpha=0.8) > pylab.hist(data2, normed=True, alpha=0.5, fc='yellow') > pylab.legend(["data 1", "data 2"]) Here's a workaround that probably explains why this is happening: _, _, h1 = pylab.hist(data1, normed=True, alpha=0.8) _, _, h2 = pylab.hist(data2, normed=True, alpha=0.5, fc='yellow') pylab.legend([h1[0], h2[0]], ["data 1", "data 2"]) By default, the legend function assigns a legend entry to every patch in the figure. Perhaps this could be seen as a bug in (hist or) legend, but I don't know how to fix it without introducing difficulties in other cases. -- Jouni K. Seppänen http://www.iki.fi/jks ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users