1
votes

I'm having troubles with gnuplot rendering all but one line as dashed. Namely, after setting

gnuplot> set terminal postscript eps color
gnuplot> set term postscript eps color linewidth 2 
gnuplot> set output "local1.eps" 
gnuplot> set pointsize 0.5

and invoking

plot "YY_globalized.txt" using 1:2 title "Global approach" with linespoints linetype 1 pointtype 1, "YY_localizedPlain.txt" using 1:2 title "Localized Opt" with linespoints linetype 11 pointtype 2

one line is solid, while the other is dashed. In case of multiple lines, each is getting its own style, different from dashed. Is there a way to specify that all the lines should be solid, but with different color (and, possibly, with different point style)?

Thanks.

2
Could maybe this question help you? It looks like a duplicate...Woltan

2 Answers

6
votes

Just specify the the terminal option 'solid' in your first line:

gnuplot> set terminal postscript eps color solid
0
votes

Yes, there is a way. You specify linetype for each dataset to 1 to force a solid line and change the line color with another option to distinguish them. Here is your modified plot command:

plot "YY_globalized.txt" using 1:2 title "Global approach" with linespoints linetype 1 pointtype 1 linecolor 1, "YY_localizedPlain.txt" using 1:2 title "Localized Opt" with linespoints linetype 1 pointtype 2 linecolor 2

This produces first line solid red, the second line solid green. In essence (omitting irrelevant options for readability) it comes down to this

plot "data1" linetype 1 linecolor 1 \
 ,   "data2" linetype 1 linecolor 2

There might be a smarter way to unify some line options using line styles (see documentation), but you would have to specify line color for each of the data sets by hand anyway.