来自两个文件的gnuplot绘图数据:在一个x坐标中,在另一个y中 [英] gnuplot plot data from two files: in one x coordinate, in other y

查看:224
本文介绍了来自两个文件的gnuplot绘图数据:在一个x坐标中,在另一个y中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个文件:一个带有x坐标,另一个带有y.

I have two files: one with x coordinates, and other with y.

是否可以使用gnuplot在一个图形中绘制这两个文件? 还是有办法逐行连接这两个文件?

Is there a way to plot this two files in one graph using gnuplot? Or is there a way to concat row by row this two files?

谢谢

推荐答案

在gnuplot中,没有一种方法可以从一个文件绘制x坐标,而从另一个文件绘制y坐标.

There is not a way to plot the x coordinate from one file and the y coordinate from another natively in gnuplot.

如果使用类似bash的外壳,则可以使用命令

If you use a bash-like shell, you can use the command

paste x_data.dat y_data.dat > xy_data.dat

逐行合并文件.如果要将此命令放入gnuplot脚本中,则可以这样做:

to combine files row-by row. If you want to put this command into a gnuplot script, you can do so like this:

plot "<paste x_data.dat y_data.dat"

这篇关于来自两个文件的gnuplot绘图数据:在一个x坐标中,在另一个y中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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