Discussion:
Multiple coloured point lines
(too old to reply)
db
2024-02-21 13:21:11 UTC
Permalink
Here is a mini example

gnuplot << eoi
set term postscript enh color eps 24
set output 'mini.eps'
set xlabel "x"
plot x w p pt 7 rgb 'black', \
x/2 w p pt 7 rgb 'red'
quit
eoi
gv mini.eps

This baulks at the first "rgb":

gnuplot> plot x w p pt 7 rgb 'black', x/2 w p pt 7 rgb 'red'
^
line 0: unexpected or unrecognized token: rgb

But if I leave out the second plot line (and terminate
the first properly (no ", \)) it gives me a plot of
a lot of blue points.
Why can't I have several coloured plots?
--
Dieter Britz
Karl Ratzsch
2024-02-22 20:15:12 UTC
Permalink
The syntax is

plot x lc rgb "black", x/2 lc rgb "red"

You missed the "lc" specifier.
Post by db
Here is a mini example
gnuplot << eoi
set term postscript enh color eps 24
set output 'mini.eps'
set xlabel "x"
plot x w p pt 7 rgb 'black', \
     x/2 w p pt 7 rgb 'red'
quit
eoi
gv mini.eps
gnuplot> plot x w p pt 7 rgb 'black',      x/2 w p pt 7 rgb 'red'
                         ^
         line 0: unexpected or unrecognized token: rgb
But if I leave out the second plot line (and terminate
the first properly (no ", \)) it gives me a plot of
a lot of blue points.
Why can't I have several coloured plots?
Loading...