值得阅读help coordinates 了解不同的坐标系。简而言之,first 坐标系是由 x 和 y 轴的当前范围定义的:图形的左下角有坐标 (xmin,ymin),右上角有坐标 (xmax, ymax) .在graph 坐标系中,左下角始终为 (0,0),右上角始终为 (1,1),与两个轴的范围无关。
这是一个简单的例子:
set xrange [-4:4]
set yrange [-3:3]
set grid
set arrow 1 from first 0,0 to first 1,1 ls 1 lw 3
set arrow 2 from graph 0,0 to graph 1,1 ls 2 lw 3
plot 1/0 ti ""
紫色向量是箭头 1,在first 坐标系中从 (0,0) 到 (1,1)。第二个向量是箭头 2,在graph 坐标系中从 (0,0) 到 (1,1)。
将使用坐标系的默认规则是
如果未指定 x 的坐标系,则使用 first。如果
y的系统未指定,采用x的系统。
对于set arrow的特殊情况,
坐标系说明符不会从第一个端点描述[到]第二个端点。
听起来你想使用first坐标系,所以你不应该做任何事情:
set arrow from 0, y(x) to x, y(x)
当你使用
set arrow from graph 0, y(x) to x, y(x)
您使用graph 坐标系作为起点,使用first 坐标系作为终点。
当你使用
set arrow from graph 0, first y(x) to x, y(x)
您使用graph 坐标系作为起点的x 坐标,使用first 坐标系作为其余坐标。如果 x 轴的范围从零开始,这与使用 first 坐标系的所有内容相同。