几个数据文件如下所示
1 342 345 564
2 254 543 432
3 341 988 343
4 454 324 342
...都有相同的第一列。我打算使用gnuplot烛台来绘制数据。这是我正在使用的函数:
plot 'file1.txt' using 1:3:2:6:5:xticlabels(7) with candlesticks title '1' whiskerbars,
'file2.txt' using 1:3:2:6:5:xticlabels(7) with candlesticks title '2' whiskerbars lt 1 linecolor 3,
'file3.txt' using 1:3:2:6:5:xticlabels(7) with candlesticks title '3' whiskerbars lt 1 linecolor 7但是,这些行是重叠的,我希望file1.txt数据从开始,例如。10,file2.txt数据从12开始,file3.txt数据从14开始。每个增量都应该是10。这样,我希望得到不同文件的行分组,中间有分隔。
如何做到这一点呢?gnuplot调整或输入文件调整都是可接受的(后者意味着我首先自动将一个文件的第一列更改为10的倍数,将另一个文件的第一列更改为10加2的倍数……)
发布于 2012-05-02 23:46:56
如果您想要操作第一列,可以使用using非常容易地完成。例如:
plot 'datafile' using 1:2, \
'datafile' using (10*$1):2, \
'datafile' using ((10+2)*$1):2
...第一个图的x值将等于第一列,第二个图的x值将等于10*first_column,第三个图的x值将等于12*first_column...
https://stackoverflow.com/questions/10415766
复制相似问题