Discussion:
rgb
(too old to reply)
db
2024-04-29 14:50:59 UTC
Permalink
In a script intended to plot two sets of data points,
the plotting statement is

plot 'plotII.dat' w p pt 7 rgb "blue",\
'plotIII.dat' w p pt 7 rgb "red"

This produces the following error message.

gnuplot> plot 'plotII.dat' w p pt 7 rgb "blue", 'plotIII.dat' w p pt 7
rgb "red"
^
line 0: unexpected or unrecognized token: rgb

But if I remove the second half, from the comma
onwards, it does plot the first set as blue points.
Why is this, and what should I do?
--
db
Jörg Buchholz
2024-04-30 05:12:42 UTC
Permalink
Post by db
In a script intended to plot two sets of data points,
the plotting statement is
plot 'plotII.dat' w p pt 7 rgb "blue",\
'plotIII.dat' w p pt 7 rgb "red"
This produces the following error message.
gnuplot> plot 'plotII.dat' w p pt 7 rgb "blue", 'plotIII.dat' w p pt 7
rgb "red"
^
line 0: unexpected or unrecognized token: rgb
But if I remove the second half, from the comma
onwards, it does plot the first set as blue points.
Why is this, and what should I do?
morning,

you must put a "lc" for linecolor in front of the rgb.

plot 'plotII.dat' w p pt 7 lc rgb "blue",\
'plotIII.dat' w p pt 7 lc rgb "red"

Jörg
db
2024-04-30 08:35:18 UTC
Permalink
Post by Jörg Buchholz
Post by db
In a script intended to plot two sets of data points,
the plotting statement is
plot 'plotII.dat' w p pt 7 rgb "blue",\
'plotIII.dat' w p pt 7 rgb "red"
This produces the following error message.
gnuplot> plot 'plotII.dat' w p pt 7 rgb "blue", 'plotIII.dat' w p pt 7
rgb "red"
^
line 0: unexpected or unrecognized token: rgb
But if I remove the second half, from the comma onwards, it does plot
the first set as blue points.
Why is this, and what should I do?
morning,
you must put a "lc" for linecolor in front of the rgb.
plot 'plotII.dat' w p pt 7 lc rgb "blue",\
'plotIII.dat' w p pt 7 lc rgb "red"
Jörg
Thank you, that works. I wonder why it works for
just one without the lc.
--
db
Karl Ratzsch
2024-04-30 19:30:48 UTC
Permalink
Post by db
Post by Jörg Buchholz
Post by db
In a script intended to plot two sets of data points,
the plotting statement is
plot 'plotII.dat' w p pt 7 rgb "blue",\
'plotIII.dat' w p pt 7 rgb "red"
This produces the following error message.
gnuplot> plot 'plotII.dat' w p pt 7 rgb "blue", 'plotIII.dat' w p pt 7
rgb "red"
^
line 0: unexpected or unrecognized token: rgb
But if I remove the second half, from the comma onwards, it does plot
the first set as blue points.
Why is this, and what should I do?
morning,
you must put a "lc" for linecolor in front of the rgb.
plot 'plotII.dat' w p pt 7 lc rgb "blue",\
'plotIII.dat' w p pt 7 lc rgb "red"
Jörg
Thank you, that works. I wonder why it works for
just one without the lc.
Doesn't work here, neither with 5.4 or 6.0

gnuplot> plot '+' w p pt 7 rgb 'blue'
^
unexpected or unrecognized token: rgb

or an ancient 4.6

gnuplot> plot '+' w p pt 7 rgb 'blue'
^
';' expected

Best, Karl

Loading...