0

I'm trying to figure out how to draw dotted lines in gnuplot (see my code below). I've been reading this post but it hasn't worked for me. If I try:

set termoption dashed
set for [i=1:8] linetype i dashtype 

I get Extraneous arguments to set linetype

Any idea how to change line style 3 to dotted or dashed?

set parametric
unset key
unset tics
unset border 

set object rectangle from screen 0,0 to screen 1,1 behind fillcolor rgb 'white' fillstyle solid noborder

set style line 4 lc rgb 'black' pt 7
set style line 1 lc rgb 'blue' pt 7 ps 4
set style line 2 lc rgb 'red' pt 7 ps 3
set style line 3 lc rgb 'blue' pt 7 ps 3 

splot [t=-pi/2:3*pi] sin(t),cos(t),t*0.23246067325 ls 4,  '-' w p ls 1,  '-' w p ls 1,  '-' w p ls 1, '-' w p ls 2, '-' w p ls 2, '-' w p ls 2, '-' w p ls 2, '-' w p ls 2
0.0 1.0 0.0
e
0.0 1.0 1.4605934866804429
e
1.0 0.0 0.3651483716701107
e
0.0 -1.0 0.7302967433402214
e
-1.0 0.0 1.0954451150103321
e
1.0 0.0 1.8257418583505536  
e
0.0 -1.0 2.19089023002
e
-1.0 0.0 -0.3651483716701107
e


set xrange [-5:5]
show xrange
set yrange [-5:5]
show yrange


set arrow from 0.,1.0,0. to 0.0, 1.0, 1.4605934866804429 nohead ls 3
set arrow from 0.,1.0,0. to 1.0, 0.0, 0.3651483716701107 nohead ls 3
set arrow from 0.0, 1.0, 1.4605934866804429 to 1.0, 0.0, 0.5651483716701107 nohead ls 3
Community
  • 1
  • 1
dorien
  • 5,265
  • 10
  • 57
  • 116
  • Please read the post you linked to again. You mix options for different gnuplot versions: `set termoption dashed` is for <= 4.6, and `dashtype` works since 5.0 and required an argument, like `dashtype 2`. – Christoph Nov 19 '15 at 19:05
  • If you are using gnuplot 5.0, my answer to [Exact meaning of dashtype index in the Gnuplot 5.0?](http://stackoverflow.com/a/29950759/2604213) should help you. – Christoph Nov 19 '15 at 19:13
  • I am using gnuplot 4.6. So I should just use "set termoption dashed". But how to I define the linestyle itself then? I seem to be missing something. – dorien Nov 19 '15 at 20:36
  • Mmmm or maybe I should only use: set style line 3 lc rgb 'blue' pt 7 ps 3 linetype 3? That doesn't seem to work though. – dorien Nov 19 '15 at 20:41
  • Also "set style line 3 lc rgb 'blue' pt 7 ps 3 lt 3" doesn't work. – dorien Nov 19 '15 at 20:46
  • Maybe my current terminal does not permit it? I also found set termoption dash. Is termoption the right reference for the current (normal) terminal? (I can't use pngcairo because I want to rotate the picture first before taking a screenshot). – dorien Nov 19 '15 at 20:53
  • Correct, the `png` terminal doesn't support dashed or dotted lines. Otherwise you must use either `set terminal ... dashed` or `set termoption dashed` together with `set style line 3 lc rgb 'blue' pt 7 ps 3 lt 3`. But I don't understand your explanation why you cannot use pngcairo. – Christoph Nov 19 '15 at 20:59
  • It didn't want to work in gnuplot 4.6, I don't understand why. So I installed 5, which messed up the fonts in my labels a bit (but all fixable). Works with: set termoption dashed and set style line 3 lc rgb 'blue' pt 7 ps 6 dt (2,4,2,6) lw 6 – dorien Nov 19 '15 at 21:26

0 Answers0