http://gnuplot.sourceforge.net/demo_4.2/rgb_variable.html
I have a data file with lines like:
10 20 3
5 30 6
The first two values are x and y. Third value is size. I want the RGB
value to be calculated from x and y. Here is my script:
set terminal png nocrop enhanced size 420,320
set output "graph.png"
set title "Measurements"
rgb(r,g,b) = int(r)*65536 + int(g)*256 + int(b)
plot "data" using 1:2:3:(rgb($1,$2,0)) with points pt 7 ps variable lc
rgb variable
When I run it (gnuplot 4.2, Debian Sarge), I get:
"scatter.gnu", line 6: Too many using specs for this style
Any ideas? Help would be greatly appreciated!
regards, Andy
Yes. Your commands are correct, and they work fine in the CVS
version of gnuplot. However, the use of variable color in 2D plots
was a last minute extension that didn't quite make it into the
4.2.0 release. It will be in the 4.2.1 incremental release,
expected in the next month or so.
As a work-around, in most cases it is possible to use a 3D plot with
"set view map" and giving a dummy Z coordinate. So your command
would become:
splot "data" using 1:2:(0):3:(rgb($1,$2,0)) \
with points pt 7 ps variable lc rgb variable
--
Ethan A Merritt
Andy