在gnuplot中更改x值 [英] Change x-values in gnuplot

查看:101
本文介绍了在gnuplot中更改x值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在绘制一列代表gnuplot中时间序列的数据.每个值代表500次迭代/时间单位后的时间值.我可以告诉gnuplot将其显示的x值乘以500吗?

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.

我不想手动创建带有x值的额外列,因为我有很多不同长度的不同数据.我不想为每个人创建一个x列.

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.

推荐答案

如果只有一列,则gnuplot会将行号用作x值.可以通过伪列0对其进行访问,并按类似的比例缩放

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

或等效地,如果您是从shell脚本中调用的

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

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

这篇关于在gnuplot中更改x值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆