首页 > 解决方案 > 在 MacOS 上,如何在 Octave 5.1 上包含来自 octave-cli 的 Octave 图形工具包?

问题描述

在 MacOS 下(Sierra 10.13.6,如果重要的话),我开发了一些 Octave 脚本,它们在 Octave-gui 下运行良好,但不能从 octave-cli 运行。它们包括用于绘制结果的图形;当从 cli 启动 Octave 时,如何包含所需的图形工具包?

我尝试了其他提示和技巧,包括增强路径和向 octave-cli 添加别名,这使得从脚本启动 octave-cli 变得更简单,但仍然得到:

GNU Octave, version 5.1.0
Copyright (C) 2019 John W. Eaton and others.
...
octave:1> gt_7tCurrieLiFe1 
Time to read the dataset:  0.48 sec 
Time to parse the dataset: 0.0013 sec 
Time for loop over the dataset: 18.47 sec 
error: no graphics toolkits are available!
error: called from
    figure at line 91 column 7
    gt_7tCurrieLiFe1 at line 61 column 1
...
[line 61 of gt_7tCurrieLiFe1.m]
plot(1:endcount, gt_data(:,3), "linestyle", "-", ...
     1:endcount, gt_data(:,4), "linestyle", "--")
...

我所期望的是,当从 Octave GUI 运行相同的脚本时,绘图窗口会打开。

感谢您提供任何提示以进一步完成此任务。

标签: plotcommand-line-interfaceoctave

解决方案


推荐阅读