如何在 gnuplot 中绘制编号大于 1000 的列

How to plot columns numbered greater than 1000 in gnuplot

我有一个包含 1600 列的文件。

plot "file" using 1:999 title columnhead(999)

绘制第 999 列,但

plot "file" using 1:1000 title columnhead(1000) 

生成第 100 列而不是第 1000 列,生成与

相同的结果
plot "file" using 1:100 title columnhead(100)

明显大的列号被换行了。是否有解决方法以便我可以绘制更大的列号?

是的,这是一个错误,请参阅 #1596 columnhead(x) does not work for x>=1000

作为解决方法,您可以提取第一行,例如使用命令行工具 head,并使用 word:

访问内容
header = system('head -n 1 file')
plot 'file' using 1:1000 skip 1 title word(header, 1000)