gnuplot 在绘图范围外的点之间画线

gnuplot draw line between points outside plot range

下面在两点之间画一条线:

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

只要两个点中至少有一个在 x/yrange 内,这就可以正常工作。但是,如果放大使得两个点都在轴范围之外,则会显示一个空图表:

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

此行为不同于 Excel,后者仍然显示该行。知道如何在 gnuplot 中执行此操作,即我需要查看两点之间的连接线,即使这些点本身在绘图范围之外。

使用选项

set clip two

来自文档:

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.