我有一些像这样的数据文件:
Id a1 a2 a3
1 1 2 3
2 2 3 4
3 2 3 4
Run Code Online (Sandbox Code Playgroud)
但我不知道列的确切数量,但我可以将它变为shell变量.我想绘制数据文件,第一列作为x轴,其他作为y轴在一张图片中,列标题作为行的标题.如下:

如何在gnuplot中绘图?非常感谢
考虑这个例子
colhead.gp:
plot for [i=2:n+1] 'colhead.dat' u 1:i w lp title columnheader(i)
Run Code Online (Sandbox Code Playgroud)
colhead.dat:
Id a1 a2 a3
1 1 2 3
2 2 3 4
3 2 3 4
Run Code Online (Sandbox Code Playgroud)
要从shell获取参数:
gnuplot -persist -e "n=4" colhead.gp
Run Code Online (Sandbox Code Playgroud)