Reputation: 1175
In the below code, the appearance of the curve plotted takes into account linetype
and linewidth
but it completely ignores linecolor
.
set style line 1 linetype 1 linewidth 10 linecolor rgb "blue"
plot \
myfile using 1:2 with lines linestyle 1
I have tried to change the order of these items, as well as different ways of specifying color, eg. "#0000FF" instead of "blue".
How can I change this to have the curve take on the color specified via linestyle 1
?
This is gnuplot 5.4 on Mac OS / Big Sur, tried with "Terminal" and "iterm2".
IMPORTANT UPDATE
I'm using set term postscript eps
. When i change this to set term pngcairo
everything is ok.
So my updated question is: How to make this work also with set term postscript eps
?
Upvotes: 1
Views: 527
Reputation: 26088
Apparently, the default setting for the postscript terminal is monochrome
and you have to explicitely set color
. I remember having seen similar questions in the past. I don't know why default is monochrome
, maybe historical reasons? So, it seems to be a recurring "pitfall", since users nowadays think everything is in color per default ;-).
set term postscript eps color
That's what I get (on a "fresh" console) if I type set term postscript eps
. Apparently, text is in color per default (i.e. labels and arrows), but the rest seems to be monochrome
.
Options are 'eps enhanced defaultplex \
leveldefault monochrome colortext \
dashlength 1.0 linewidth 1.0 pointscale 1.0 butt noclip \
nobackground \
palfuncparam 2000,0.003 \
"Helvetica" 14 fontscale 1.0 '
Upvotes: 1
Reputation: 1175
set term epslatex
...and it works! (since i wanted "eps", and got "eps").
Incidentially (although it produces "png" instead of "eps") set term pngcairo
and possible many more "term"s also work.
Strange thing is that I didn't get any warning when plotting with set term postscript eps
that gnuplot was not able to apply the linestyle coloring with that terminal mode.
Upvotes: 0