From: Ed S. <eds...@gm...> - 2007-09-22 15:53:59
|
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 |