我有一张这样的表:
A B C D E F G H I
10 23998 16755 27656 17659 19708 20328 19377 18925
20 37298 33368 53936 41421 44548 40756 40985 37294
我使用此命令绘制
plot "C:/file.txt" using 1:2 with lines smooth bezier, "C:/file.txt" using 1:3 with lines smooth bezier, ...
但是,所有标签都以文件名的形式出现。 gnuplot是否可以读取第一行并相应地标记行?
答案 0 :(得分:28)
set key autotitle columnhead
答案 1 :(得分:3)
[n = 2:12]'vv.csv'u 1的绘图:(列(n))w行标题列头(n)
答案 2 :(得分:2)
我检查了文档,我没有看到自动执行此操作的方法,但您可以使用
手动设置标题plot "file.txt" using 1:2 title "A" with lines smooth bezier ...
答案 3 :(得分:0)
我曾经wrote使用每个广播电台的名称作为垂直标签,沿着87MHz到108MHz的轴绘制FM广播电台频率的脚本。这不是一个纯粹的gnuplot解决方案,输入文件是用perl和make处理的,但我建议你看看它,看看你是否可以使用类似的东西。
答案 4 :(得分:0)
如果您想要绘制大量数据并且想要自动提取标题,也可以使用gnuplot工具包,例如this one for Python。