具有“自动"功能. X [英] Having "automatic" x

查看:70
本文介绍了具有“自动"功能. X的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是一个简单的问题(我想),但是,可以说我有以下数据文件:

Just a simple question (I imagine) but, lets say I have the following data file:

# no x data, it's sampled for instance each second.
23 42 48 
49 89 33
39 44 97

如何(如果可能的话)将其绘制为

How (if possible) can I plot that as if it were

1 23 42 48 
2 49 89 33
3 39 44 97

使用1,2,3,..(第一列)作为x?

using the 1,2,3,.. (first column) as x ?

做类似的事情:例如plot "file.dat" using (lineNumber):3.

doing something like: plot "file.dat" using (lineNumber):3 for instance.

推荐答案

例如绘制数据文件的第三行:

E.g. to plot the third line of the datafile:

plot "DATAFILE" u 3

awk:

plot "<awk '{print FNR,$0}' DATAFILE" u 1:4 

请注意,awk会添加行号,因此第一列是行号.

Note that awk adds linenumbers, so the first column is linenumber.

相同,gnuplot自动使用x轴的行号

does the same, gnuplot is automatically using the line-number for the x-axis

这篇关于具有“自动"功能. X的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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