Hello,
I am having trouble getting gnuplot to work. I am trying to produce eps graphics files,
but I (i) cannot get the line colors right (the second line is neon green. I need line one
to be black, line two to be red and line three to be blue) and (ii) the graphic file has
no buckhound, i.e. the background is transparent (this is not a huge deal). Here is the
code I am using
gnuplot R1_@cc R2_@cc \
--time-series \
--single-yaxis \
--with-lines \
{ set terminal postscript eps enhanced "Helvetica, 10" dashed color size
2.5,1.75;\
set key left top;\
set linestyle 1 lt 1 lc 7;\
set linestyle 2 lc 1 lt 2;\
set linestyle 3 lc 3 lt 5; }\
--output="Bench_(a)cc.eps"
I am using gretl 1.9.9, Gnuplot 4.2 on a Win 7 64 bit OS
Any ideas on what I am doing wrong?
Thanks,
Logan
Show replies by date
Dear Logan,
I made some tests and I'm getting the same problem as the one described by
you. Please take a look at my simple example:
<hansl>
open australia.gdt
series line1 = PAU # black: #000000
series line2 = 0.1 * PAU # red: #FF0000
series line3 = 0.2 * PAU # blue: #0000FF
# Color definition works!
gnuplot line1 line2 line3 \
{ set key left top;\
set linestyle 1 lc rgb "#000000";\
set linestyle 2 lc rgb "#FF0000";\
set linestyle 3 lc rgb "#0000FF";}\
--time-series --single-yaxis --with-lines --output=display
# Color definition works!
gnuplot line1 line2 line3 \
{ set key left top;\
set linestyle 1 lc rgb "#000000";\
set linestyle 2 lc rgb "#FF0000";\
set linestyle 3 lc rgb "#0000FF";}\
--time-series --single-yaxis --with-lines --output=logan.png
# Color definition doesn't work!
gnuplot line1 line2 line3 \
{ set key left top;\
set linestyle 1 lc rgb "#000000";\
set linestyle 2 lc rgb "#FF0000";\
set linestyle 3 lc rgb "#0000FF";}\
--time-series --single-yaxis --with-lines --output=logan.eps
</hansl>
I am using Gretl 1.9.11cvs on Windows Vista.
Best regards,
Henrique Andrade*
*
Thanks Henrique,
I did some more digging myself, and I think I know how to fix the problem with output to
an eps file. (Note, I think this is an issue with GNUPlot not Gretl or the gnuplot command
in hansl.)
For the GNUPlot command
<hansl>
set linestyle 1 lc rgb "#000000";
</hansl>
To be used by the postscript terminal you need the command
<hansl>
set style increment user;
</hansl>
I found this description: "By default, successive plots within the same graph will
use successive linetypes from the default set for the current terminal type. However,
choosing set style increment user allows you to step through the user-defined line styles
rather than through the default linetypes." Thus the following works fine
<hansl>
gnuplot DM1_@cc DM2_@cc SS_@cc \
--time-series \
--single-yaxis \
--with-lines \
{ set terminal postscript eps enhanced "Helvetica, 10" dashed size
2.5,1.75;\
set key right bottom;\
set style line 1 lc rgb "#000000";\
set style line 2 lc rgb "#ff0000";\
set style line 3 lc rgb "#0000ff";\
set style increment user; }\
--output="Results_(a)cc.eps"
</hansl>
I am not sure why this extra line of code is needed for the postscript terminal and not
the other terminals.
Cheers,
Logan
From: gretl-users-bounces(a)lists.wfu.edu [mailto:gretl-users-bounces@lists.wfu.edu] On
Behalf Of Henrique Andrade
Sent: Tuesday, January 15, 2013 10:45 AM
To: Gretl list
Subject: Re: [Gretl-users] gnuplot: How to format an eps file
Dear Logan,
I made some tests and I'm getting the same problem as the one described by you. Please
take a look at my simple example:
<hansl>
open australia.gdt
series line1 = PAU # black: #000000
series line2 = 0.1 * PAU # red: #FF0000
series line3 = 0.2 * PAU # blue: #0000FF
# Color definition works!
gnuplot line1 line2 line3 \
{ set key left top;\
set linestyle 1 lc rgb "#000000";\
set linestyle 2 lc rgb "#FF0000";\
set linestyle 3 lc rgb "#0000FF";}\
--time-series --single-yaxis --with-lines --output=display
# Color definition works!
gnuplot line1 line2 line3 \
{ set key left top;\
set linestyle 1 lc rgb "#000000";\
set linestyle 2 lc rgb "#FF0000";\
set linestyle 3 lc rgb "#0000FF";}\
--time-series --single-yaxis --with-lines --output=logan.png
# Color definition doesn't work!
gnuplot line1 line2 line3 \
{ set key left top;\
set linestyle 1 lc rgb "#000000";\
set linestyle 2 lc rgb "#FF0000";\
set linestyle 3 lc rgb "#0000FF";}\
--time-series --single-yaxis --with-lines --output=logan.eps
</hansl>
I am using Gretl 1.9.11cvs on Windows Vista.
Best regards,
Henrique Andrade