2017-08-30 75 views
1

我有一组500个数据点,但我希望从1到100标记X轴,因为这是100纳秒内的500个数据点大体时间。生成我自己的X轴值/用自己的值替换X轴

这里是我的gnuplot的输入文件:

set xtics font "Arial,18" 
set terminal pdf solid font 'Arial,18' # pdf files are great for inkscape 
set output 'plot.pdf' 
unset label # Remove all labels 
unset xtics; unset ytics # Remove all tics 
set ytics nomirror # Only have tics on left 
set xtics nomirror # Only have tics on bottom 
set border 3 # Only have border on bottom and left 
set yrange [0:] 
set ylabel "RMSD " offset 2 
set xlabel "Simulation Time (ns)" offset -2 
plot "PvP_all.agr" using 1:2 title '' with lines lw 1 

下面是从PvP_all.agr前15行:

@with g0 
@ xaxis label "Frame" 
@ yaxis label "" 
@ legend 0.2, 0.995 
@ legend char size 0.60 
@ s0 legend "PvP_all" 
@target G0.S0 
@type xy 
1.000  1.4106 
2.000  2.3436 
3.000  1.8033 
4.000  1.9517 
5.000  1.9163 
6.000  1.7445 
7.000  1.8902 

列继续500.000

This is an imgur hosted image of the resulting plot

什么我想要的是完全相同的数据,但X轴笑这个数字是1到100,每25个抽搐一次,而不是1到500次。我该怎么做?后期编辑将不起作用,因为我有很多它们需要制作。

注意:原始编辑为我链接到r问题,并错误地尝试在gnuplot中使用r命令。

+0

确实,链接的答案与gnuplot无关,所以你当然不会找到这些命令。如果你能更好地解释你真正想要的,以及你的数据是怎样的,我们可以帮助你。 – Christoph

+0

感谢@Christoph我编辑了这篇文章。 – Oly

回答

0

您可以随时使用的行号产生这样的数据。它可以在“使用”说明符中作为(伪)列0来引用,例如

t(n) = 0.2 * n 
plot dataf using (t($0)):2 w l 

(“行数”是指具有有效数据的行数。留言,坯料不计算在内。)

正如在第一列中保存的线数,则当然也可以使用该代替。

连续数据块(由单个空行分隔)和数据集(由双空行分隔,请参阅“帮助索引”)的数量可以引用为列数“-1”和“-2”,btw。请参阅“帮助伪列”。

0

尝试

set xtics 25 
plot "PvP_all.agr" using ($1/5):2 title '' with lines lw 1