1
votes

I am using gnuplot for Windows using the default windows terminal. I need to plot a dashed line instead of normal solid line

I used

set style line 1 lt 0 lc 3
plot 'dashcca.txt'

but it does not work

Any suggestions?

1
Which terminal are you using exactly?Bernhard
Did you try to change lt 0 to lt 1?Bernhard

1 Answers

2
votes

See help terminal windows, which shows you the terminal option dashed. Either use

set terminal windows dashed

or

set termoption dashed

And of course you must use a line type which is dashed. Type test to see all supported line types with the current terminal settings.

In order to use a certain dash pattern with a different line color, use e.g.

plot x linetype 2 linecolor 1

This uses the dash pattern of line type 2, and the color of line type 1 (red). You can use arbitrary colors with linecolor rgb:

plot x linetype 2 linecolor rgb 'black', x**2 linetype 3 linecolor rgb '#bb0000'