I'm trying to specify the colours for markers in a call to scatter.
I've read this information in the documentation:
a color. c can be a single color format string, or a sequence of
color specifications of length N, or a sequence of N numbers to be
mapped to colors using the cmap and norm specified via kwargs (see
below). Note that c should not be a single numeric RGB or RGBA
sequence because that is indistinguishable from an array of values to
be colormapped. c can be a 2-D array in which the rows are RGB or
My interpretation of this is that either of the three values attempted
in the code example should work. However, all of these fail.
from pylab import *
x = [1,2,3]
y = [2,4,6]
c = ['#ff0000', '#00ff00', '#0000ff']
c = ['b','r', 'g']
c = [(1,0,0), (0,1,0), (0,0,1)]
scatter(x, y, c=c)
If I change the call to scatter() to a call to bar() as so:
bar(x, y, color = c)
then each of the three examples work as I would expect.
Am I missing something in my interpretation of the documentation for
scatter? Can anyone point out what I've missed?