如何在gnuplot中读取脚本(存储为文件)

Pra*_*mar 0 gnuplot

我希望gnuplot读取脚本并相应地生成图形。脚本应该是哪种文件,读取文件的语法是什么。

Fea*_*ear 5

要运行名为“ 文件名 ” 的脚本,您可以输入

gnuplot "filename"
Run Code Online (Sandbox Code Playgroud)

或者在交互式gnuplot环境中,您可以通过键入以下内容加载脚本文件:

load "filename"
Run Code Online (Sandbox Code Playgroud)

编辑:根据加布里埃尔(Gabriel)在下面的评论,您可以使用-p--persist选项让脚本生成的图持久存在,并关闭gnuplot会话。请注意,持续存在的情节将没有任何交互功能,例如缩放/滚动。

gnuplot -p "filename"
Run Code Online (Sandbox Code Playgroud)

gnuplot官方文档中有更多信息(第22页)