使用gnuplot绘制具有多行的CSV文件 [英] Plot csv file with multiple rows using gnuplot
本文介绍了使用gnuplot绘制具有多行的CSV文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个csv文件,其中包含500行和100列.
I have a csv file which contains 500 rows and 100 columns.
我想按以下方式绘制数据:
I want to plot the data in the way that:
- 每一行代表图形上的一条曲线.每列代表一个曲线上的值(100个值).
- 在图形上有500条这样的曲线.
代码:
set xrange [0:100]
set yrange [0:20]
set term png
set output 'output.png'
set datafile separator ','
plot 'myplot.csv'
但这似乎不起作用.我该如何配置gnuplot来实现这一目标?
But this does not seem to work. How can I configue gnuplot to achieve that?
数据采用以下格式(变短):
The data is in this format (Shortened):
7.898632397,7.834565295,8.114238484,7.636553599,7.759415909,7.829112422
7.898632397,8.379427648,8.418542273,7.921914453,7.558814684,7.237529826
7.898632397,7.862492565,8.132579657,8.419279034,8.350564183,8.578430051
7.898632397,7.613394134,7.213820144,7.42985323,7.74212712,7.144952258
7.898632397,7.736819889,8.14247944,8.025533212,8.256498438,8.133741173
7.898632397,7.906868959,8.032605101,8.308540463,8.238641673,8.143985756
推荐答案
set datafile separator comma
plot for [row=0:*] 'myplot.csv' matrix every :::row::row with lines
但是我怀疑有500条线会导致情节过于拥挤而无法解释.
However I suspect that with 500 lines the plot will be too crowded to interpret.
这篇关于使用gnuplot绘制具有多行的CSV文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文