My data is like this:
156 65 "black"
160 77 "black"
159 78 "black"
I also tried like this:
156 65 black
160 77 black
159 78 black
I get this error:
gnuplot> plot 'data' using 1:2:3 with points lc variable
^
warning: Skipping data file with no valid points
^
x range is invalid
But the same file plots OK like this:
gnuplot> plot 'data' using 1:2 with points
Then all the points are defaulted to red.
Can anybody tell me what I'm doing wrong?
Cheers,
Peter
The syntax you are trying to use is for specifying the _color index_
of the point/line.
That is, plotting the following data with your first plot command:
156 65 11
160 77 22
159 78 33
will result in the first point plotted with the 11th defined color,
the second with the 22nd and the third with the 33rd - whatever those
may be. (These colors are also terminal-dependent.)
What you want is achieved by the following syntax:
plot 'data' using 1:2:3 with points lc rgbcolor variable
And in this case the colors need to be specified as 24 bit integers.
As far as I can tell, color names like "black" are not supported.
In certain circumstances (gnuplot built with a C library that can read
hex numbers?) you can specify those 24 bit integers in hexadecimal,
for example:
156 65 0xff0000
160 77 0x00ff00
159 78 0x0000ff
Plotting this with the plotting command above will result in a red,
blue and green point on the plot.
Péter Juhász
Thanks Péter. Now I understand.
I've now specified hex colours and it plots OK.
Cheers,
Peter