On Fri, 24 Oct 2008, Sven Schreiber wrote:
recently there has been some talk about how it would be nice if
it were possible to get dashed lines in graphs, but it seems
it's not so easy to implement due to some technical reasons in
gnuplot.
So I would like to ask the list if anybody knows any tricks how
to get dashed lines anyway, presumably by hacking the gnuplot
plot commands. I have tried to get the information from the
gnuplot manual, but have failed so far. My preference would be
using the pdf "terminal" as it seems to be called in gnuplot
jargon.
If you're hacking on a gnuplot file by hand, here's what to do:
1) In the "set term", or "set terminal", line, add the option
"dashed", e.g.
set term pdfcairo color dashed font "FreeSans,9"
(But note the anomaly that the postscript "terminal" uses dashes
by default -- with other terminals "dashed" has to be specified,
but with postscript you need to give the "solid" option to
avoid dashes.)
2) To get control over the specific dash-pattern used for a
particular line, you have to see what patterns are available for
the given "terminal", and to which "linetype" index they
correspond. For any terminal you can get this info by using the
built-in gnuplot command "test", as in:
set term pdfcairo color dashed font "FreeSans,9"
set output 'test.pdf'
test
Then look at the output in test.pdf. For pngcairo and pdfcairo
you'll see that linetypes 1, 6 and 11 give solid lines; 2, 7 and
12 give "regular dashes"; and 3, 8 and 13 give short dashes. You
could then use "linetype 2" or "lt 2" to get regular dashes.
The tricky thing, from the point of view of trying to automate
this in gretl, is that these indices are not the same for all
terminal types. However, I plan to have a go at making dashes
GUI-selectable!
Allin.