如何通过在Gnuplot脚本中指定所有点来绘制没有单独文件的数据? [英] How to plot data without a separate file by specifying all points inside the Gnuplot script?

查看:99
本文介绍了如何通过在Gnuplot脚本中指定所有点来绘制没有单独文件的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序生成调用gnuplot的bash脚本.我不想制作一个额外的文件来存储数据.有什么方法可以显式调用所有值?或可能让bash制作一个临时文件.

My program generates bash scripts that call gnuplot. I don't want to have to make an extra file to store the data; is there any way I can explicitly call all of the values? Or possibly having bash make a temporary file.

类似

plot {(1,5),(2,10),(3,1)}

这就是我要寻找的.

is what I am looking for.

推荐答案

您可以对内联数据使用语法-文件名'-'.

You can use the syntax for inline data - filename '-'.

以下示例在GIF图片(bash脚本)中生成了一个简单的图:

The following example produces a simple plot in a GIF image (bash script):

gnuplot << EOF
set terminal gif
set output 'plot1.gif'
plot '-' using 1:2
        1 10
        2 20
        3 32
        4 40
        5 50
        e
EOF

这篇关于如何通过在Gnuplot脚本中指定所有点来绘制没有单独文件的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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