1
我有表的文件繪製的曲線,在文件中的每個列對應於一個曲線gnuplot的情節在文件
例如,文件1
N plot1 plot2 plot3
1 2 3 4
2 3 4 5
我運行gnuplot的如下
gnuplot -e "set key autotitle columnhead; set title 'file1'; plot 'file1' using 1:2 with lines, 'file1' using 1:3 with lines, 'file1' using 1:4 with lines"
問題是如果我有很多曲線繪圖,我有很多列我需要在gnuplot的命令中描述它們,但是我認爲它是pret TY標準繪製與第一列每列文件,像1:2 1:3 1:4
我能做到這一點更方便的方式,而不列出所有列?使用for循環
非常感謝你的回答,你知道怎麼做是通用的,例如,如果我有少於4條曲線或4個以上? – user16168
@ user16168我真的不知道該怎麼做。 – Bernhard
您需要一個外部工具來計算列數。嘗試'MAXCOL = INT(系統( '頭-1' .file '| awk的 「{打印NF}」'))'。 – Christoph