【问题标题】:Getting a gnuplot output from a script从脚本中获取 gnuplot 输出
【发布时间】:2012-06-29 04:19:38
【问题描述】:

我有一个脚本在打开后立即关闭。我试过暂停-1,但是我有一个空窗口。我也尝试过设置输出,但显然我不能用 multiplot 做到这一点

有没有办法在使用 multiplot 时设置输出? 我在设置多图之前尝试设置输出,但是ps文件是空白的

编辑:我发现最有用的解决方案是“暂停鼠标”。我还被告知我可以使用 set output 并只执行“plot file1, file2, file3”,但我在语法上遇到了一些问题。

【问题讨论】:

  • 使用gnuplot -persistset wxt persist 有帮助吗?

标签: gnuplot


【解决方案1】:

我通常在进入多图模式之前设置输出(和终端)。您可能会注意到的一件事是,某些终端直到您 unset multiplot(参见 help multiplot)才会在多图中绘制绘图。

以下工作。

set term post enh color
set output "foo.ps"
set multiplot layout 2,1
plot sin(x)
plot cos(x)
unset multiplot

multiplot 的一个问题是您经常希望查看绘图(例如使用 x11)并将其放入文件中(例如 postscript)。最简洁的方法是使用load 命令:

#foo.gp
set multiplot layout 2,1
plot sin(x)
plot cos(x)
unset multiplot

现在你可以这样称呼了:

set term x11 persist
load "foo.gp"
set term post enh color
set output 'foo.ps'
load 'foo.gp'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-02-01
    • 1970-01-01
    • 2011-11-16
    • 2017-11-07
    • 1970-01-01
    • 2022-11-23
    • 2020-09-21
    相关资源
    最近更新 更多