Exact dashtype index in Gnuplot 5.0?

I had a problem in Gnuplot 5.0, the dash index, for example `` set dashtype 1 (2,5,2,15) '' in the manual.

My question is: what do these numbers in parentheses mean? I tried to change them to feel, but it would be nice to know the exact meaning.

My actual problem is that just using dashtype N , unfortunately, strings that are very different from the previous version 4.6. I'm just trying to reproduce the graphics that were made in gnuplot 4.6.

+1
source share
2 answers

These are numerical pairs

 <solid length>,<empty length> 

These lengths are factors in the internal length of the block. The length of the dash chart depends on the dashlength terminal option and the line width.

So having

 plot x dt (2,4,2,6) 

displays a dash, the empty space is twice as long, again the dash is the same length and the empty space is three times as large as the dash.

Actual length of the first dash then

 linewidth * terminal_linewidth * solid_length * terminal_dashlength * dash_unit 

First example:

 set terminal pngcairo size 600,50 dashlength 2 linewidth 1 set output 'dash1.png' unset border; unset key; unset tics plot 0 dt (2,4,2,6) lw 10 

enter image description here

What can be confusing is that some terminals, such as qt or wxt , use rounded lines by default (terminal option round ), which apply to each individual dash, which distorts the actually set stroke length:

 set terminal pngcairo size 600,50 round dashlength 2 linewidth 1 set output 'dash2.png' unset border; unset key; unset tics plot 0 dt (2,4,2,6) lw 10 

enter image description here

The square terminal option extends each dash by one line width at each end:

 set terminal pngcairo size 600,50 square dashlength 2 linewidth 1 set output 'dash2.png' unset border; unset key; unset tics plot 0 dt (2,4,2,6) lw 10 

enter image description here

In this last example, the final stroke lengths are (4,2,4,4).

To get the behavior of the first example (exact stroke length) also by default with other terminals, use the butt option.

+6
source

from: http://www.gnuplot.info/gnuplot_cvs.pdf page 37

 set dashtype 1 (2,5,2,15) 

means: define type 1 as:

 solid 2 empty 5 solid 2 empty 15 (== == )* 
+1
source

All Articles