有没有办法为gnuplot中的最后一个条目添加标签? [英] Is there a way to put a label for the last entry in gnuplot?
问题描述
我想使用gnuplot进行实时绘图(将数据附加到用于绘图的文件中,并使用replot进行实时绘图).我还想为绘制的最新条目添加标签.以便了解最新的价值.有办法吗?
I want to use gnuplot for real time plotting (Data gets appended to file which I use for plotting and I use replot for real time plotting). I also want to put a label for the latest entry which is plotted. So as to get a idea what is the latest value. Is there a way to do this?
推荐答案
如果您使用的是unixoid系统,则可以使用tail
从文件中提取最后一行,并以所需的任何方式分别对其进行打印.举一个简单的例子:
If you are on a unixoid system, you can use tail
to extract the last line from the file and plot it separately in whatever way you desire. To give a simple example:
plot\
"data.dat" w l,\
"< tail -n 1 data.dat" u 1:2:2 w labels notitle
这将用线绘制整个data.dat
,并用标签绘制最后一个点,标签描述值.
This will plot the whole of data.dat
with lines and the last point with labels, with the label depicting the value.
这篇关于有没有办法为gnuplot中的最后一个条目添加标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!