Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

short dashed line length in gnuplot

Tags:

gnuplot

I have a horizontal line in a diagram with the following terminal set in gnuplot:

    set terminal postscript eps size 8.5cm, 7cm enhanced color font 'Helvetica,10'
    set style line 5 lt 2 lc rgb "black" lw 3
    f(x)=5.0
    plot f(x) w l ls 5

The line width is ok, but the length of the dashes are too short. How can I increase it without changing the terminal mode to dashed line?

like image 735
user2326844 Avatar asked Feb 12 '23 07:02

user2326844


1 Answers

For the postscript terminal the default mode is already dashed, which you see when you type your set terminal line in the interactive gnuplot-terminal:

gnuplot> set terminal postscript eps size 8.5cm, 7cm enhanced color font 'Helvetica,10'
Terminal type set to 'postscript'
Options are 'eps enhanced defaultplex \
   leveldefault color colortext \
   dashed dashlength 1.0 linewidth 1.0 butt noclip \
   nobackground \
   palfuncparam 2000,0.003 \
   size 8.50cm, 7.00cm "Helvetica" 10  fontscale 1.0 '

Otherwise, in solid mode, the only dashed linetype is lt -1.

The above message also tells you, how you can change the dashlength. Up to version 4.6, the only way to change the dashlength is to use the dashlength option, e.g. with

set termoption dashlength 1.5

Unfortunately, this affects all line types.

Only 5.0 version supports arbitrary, configurable dash patterns. Note also, that in version 5 the dashlength depends on the selected line width.

like image 109
Christoph Avatar answered Mar 06 '23 16:03

Christoph