2
votes

The following draws a line between two points:

$myData<<EOD
10 0
20 10
EOD
plot $myData u 1:2 w l

This works fine as long as at least one of the two points is within the x/yrange. However, if you zoom in so that both points are outside the axes ranges, an empty chart is shown:

set yr[0:10]
set xr[12:18]

This behavior is different from Excel which still shows the line. Any idea how to do this in gnuplot, i.e. I need to see the connecting lines between two points even if the points themselves are outside the plotting range.

1

1 Answers

1
votes

Use the option

set clip two

From the documentation:

Some lines may have both endpoints out of range, but pass through the graph. Setting the two clip-type allows the visible portion of these lines to be drawn.