ziulfer
ziulfer

Reputation: 1369

gnuplot linewidth and line type with terminal postscript

In gnuplot I've using set term postscript enhanced eps color as well as lw 5 and lt 1, 2 and 3 , for three different graphs.

Due to the width of the graphs the line types don't look so different for the three cases.

If I decrease the value of lw to 2 stuffs start getting better, but I'd like to keep using the lw 5 and at the same time be able to use the different line types. Am I missing something?

EDIT

Follow two graphs. Using set term postscript enhanced eps color dashed,

enter image description here

and set term epscairo color dashed:

enter image description here

In both cases I've used lw 4.

The version with epscairo looks better, but still the dashed-dot-dot-dashed, looks awful, close to f(x)=1 for sin(2x)

Upvotes: 3

Views: 30631

Answers (2)

Christoph
Christoph

Reputation: 48430

I think this is a general problem of dashed lines with the postscript terminal: For some internal reasons, the points aren't drawn as one continuous line, but every 100 points the line is interrupted by a moveto operation. This can lead to very strange results for dashed lines.

A pathological example is

set terminal postscript eps mono dashed dl 10 lw 5
set samples 200
set output 'test.eps'
plot x lt 2

As you can see, the center dash is much longer than the others. Try using the epscairo terminal and see if this works better.

enter image description here

Upvotes: 3

Miguel
Miguel

Reputation: 7627

When you set the terminal you can specify the dash length with the dl option, this will also increase the separation between dashes:

set term postscript enhanced eps color dl 4
plot sin(x) lw 5 lt 2, cos(x) lw 5 lt 3

enter image description here

You can also add points to better distinguish your graph:

set term postscript enhanced eps color
plot "+" u ($1):(sin($1)) w lp lw 5 lt 2 ps 2 pt 7

enter image description here

Upvotes: 2

Related Questions