gnuplot:如何将数据文件的每一行绘制为Y和增量X [英] gnuplot: How to plot each line of a data file as Y and incremental X

查看:72
本文介绍了gnuplot:如何将数据文件的每一行绘制为Y和增量X的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含30列和N行的数据文件.每行对应于x = {1,...,30}的函数f(x)的30个值.数据文件具有以下模式:

I have a data file containing 30 columns and N rows. Each rows correspond to 30 values of function f(x) for x={1,...,30}. The data file has following pattern:

#<index> f(1) f(2) ... f(30)
1 7.221 5.302 ... -1.031
2 4.527 3.193 ... 0.410
...
N 6.386 1.321 ... -0.386

gnuplot将第一列解释为X,将第二列解释为Y.但是,我想要的是在单独的输出文件中绘制每一行而不转换该数据文件.例如,对于第一行,所需的输出将是gnuplot通过此输入文件得到的结果:

gnuplot interprets first column as X and the second one as Y. But, what I want is to plot each line in a separated output file without transposing this data file. For example, for the first line, the desired output would be what gnuplot gets with this input file:

# X Y
1 7.221
2 5.302
...
30 -1.031

推荐答案

更新基于@Christoph的评论:

UPDATED based on @Christoph's comment:

plot for [i=2:30] 'data.dat' using (i-1):(column(i)) with linespoint

这篇关于gnuplot:如何将数据文件的每一行绘制为Y和增量X的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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