Hi all,

I'm superimposing histograms of two data sets on the same axes, using
different colours and alpha transparency in the GtkAGG backend to show
the overlapping regions. If I plot a legend as below, the colours in
both legend entries are the same. Am I doing something wrong?

import matplotlib
matplotlib.use('GTKAgg')
import pylab
pylab.hist(data1, normed=True, alpha=0.8)
pylab.hist(data2, normed=True, alpha=0.5, fc='yellow')
pylab.legend(["data 1", "data 2"])
pylab.show()

If I try this instead:

pylab.hist(data1, normed=True, alpha=0.8, label="data 1")
pylab.hist(data2, normed=True, alpha=0.5, fc="yellow", label="data 2")
pylab.legend()
pylab.show()

the legend entries are now coloured correctly, but there is one label
entry for each bin, which is not particularly useful.

I'm using the latest SVN version of matplotlib (r3874).

I'd appreciate any comments and/or quick workarounds!

-- Ed

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

Reply via email to