Change x-values in gnuplot

纵饮孤独 提交于 2019-12-20 03:16:08

问题


I'm plotting a column of data which represents a time series in gnuplot. Every value represents a time value after 500 iterations / time units. Can I tell gnuplot to multiply the x-values it displays by 500?

I thought this would be a standard problem since every time one has to plot a time series one needs to tell the plotting program what time unit each iteration has.

I don't want to create an extra column with x-values manually, since I have a lot of different data of different length. I don't want to create a x column for everyone of them.


回答1:


If you have only a single column, gnuplot uses the row number as x value. This can be accessed by the pseudo column 0 and scaled like

plot 'datafile' using ($0*500):1

or equivalently, if you're calling this from a shell script

plot 'datafile' using (column(0)*500):1


来源:https://stackoverflow.com/questions/32526836/change-x-values-in-gnuplot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!