标记使用 gnuplot 绘制的垂直线

Label the vertical line drawn using gnuplot

我想在顶部边框处标记使用 set arrow 命令在 gnuplot 中绘制的垂直线。如何才能做到这一点?例如在附图中,我在 x=-3.8 处画了一条垂直线。我想将标签放置在这条垂直线与图的上边界相交的点的上边界。

以这种方式标记垂直线是最佳做法吗?我选择这种方式是因为在垂直线与 x 轴相交点附近的图中,已经有一个数字。所以我别无选择,只能将标签放在顶部边框。

请查看手册或在gnuplot控制台输入help label。您可以将标签设置为具有偏移量的特定坐标。

reset session

xPos = -3.8
set arrow 1 at xPos, graph 0 to xPos, graph 1 nohead lc "red" dt 4
set label 1 at xPos, graph 1 "myLabel" offset 0.5,-0.7

plot sin(x)