【问题标题】:Gnuplot script disappear after creationGnuplot 脚本在创建后消失
【发布时间】:2014-07-29 05:48:04
【问题描述】:

我有一个 gnuplot 脚本。我的系统是 ubuntu 14.04。当在终端中输入gnuplot myPlot。剧情会消失。它不会留在屏幕上。我在这个堆栈中看到了类似的question。但它的系统是windows。我想知道在 ubuntu 14.04 32 位上有什么解决方案

PS:当我使用gnuplot>时--我的意思是当我不使用脚本文件时--我看到图表并没有消失。

PS2:这是我的简单 gnuplot 脚本文件:

set boxwidth 0.5
set style fill solid
plot "dataFile" using 1:2:xtic(2) with boxes

【问题讨论】:

    标签: gnuplot


    【解决方案1】:

    如果您希望绘图窗口保持打开状态,您必须使用 -persist 标志调用 gnuplot:

    gnuplot -persist myPlot
    

    【讨论】:

    • 请记住,--persist 选项可能会在使用交互式终端(例如 qt)时禁用鼠标以及与绘制图形的任何其他交互。详细解释请查看here
    • @Wolf:man gnuplot 在选项部分中将选项显示为 -p。我使用的是 5.2 版,所以它可能比你的文档更新。
    • @userunknown 也许,现在(gnuplot 5.2 补丁级别 6)我在命令行中尝试了 gnuplot --help 并列出了此选项(-p --persist),我将删除这些 cmets...
    【解决方案2】:

    这里已经有很好的答案,但是-persist 标志对我不起作用,并且启用 x11 强制 GnuPlot 使用糟糕的 XQuarts 进行窗口化,而不是心爱的 Qt。对我有用的是

    pause -1
    

    命令 (from here) 在脚本末尾。根据the documentation

    pause -1 # 等到回车被击中

    希望对你有帮助。

    【讨论】:

      【解决方案3】:

      如果您不想使用额外参数 (-persist) 调用 gnuplot,您可以在脚本中启用此功能,例如

      set term x11 persist
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-10-07
        • 2019-06-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多