Dear all,
I am an unexperienced matplotlib user, and I have a couple of questions about adding a legend to a graph.
In this example, on my PC both the entries in the legend appear in blue color:
#!/usr/bin/env python
import numarray as na
from pylab import *
labels = ["A", "B", "C"]
first = [ 1, 2, 3 ]
second = [ 3, 2, 1 ]
xlocations = na.array(range(len(labels)))+0.33
width = 0.33
bar1=bar(xlocations, first, width=width, color='blue')
bar2=bar(xlocations+.33, second, width=width, color='red')
legend((bar1,bar2), ('First','Second'))
show()
Did I make some mistake?
Moreover, if I add a legend to a graph plotting a set with marks and without lines, the legend will show two points instead of one (which would have been the expected behaviour). Is this correct?
Thank in advance,
Gianluca