从命令行调用函数时获取八度图进行绘制 [英] Getting octave to plot when invoking a function from the command line

查看:74
本文介绍了从命令行调用函数时获取八度图进行绘制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从命令行在octave中运行一个函数.该函数当前正在运行,如下所示:

I am trying to run a function in octave from the command line. The function is currently run like so:

octave --silent --persist --eval 'function(input arguments)'

function.m包含一个plot命令.当我使用上述命令行参数调用octave时,图的确显示了,但是八度进入了交互模式.我的问题是:

function.m contains a plot command. When I invoke octave with the above command line parameters, the plot does show but octave enters into its interactive mode. My question is:

从命令行调用绘图时,有没有办法使八度音阶显示图 进入交互模式?

Is there any way to get octave to display the plot without entering the interactive mode when it is invoked from the command line?

推荐答案

AFAIK,绘图窗口是八度的子进程,因此只能在运行八度时显示.即使您从交互"模式中绘制某些内容,也可以保持打开和关闭八度的位置,该图也将消失.
您可以做的是绘制一些输出文件,例如在此处:

AFAIK, the plot window is a child process of octave and therefor can only be displayed when octave is running. Even if you plot something from the "interactive" mode leave the plot open and close octave, the plot will also disappear.
What you could do is to plot to some output file like posted here:

f = figure
set(f, "visible", "off")
plot([1,2,3,4])
print("MyPNG.png", "-dpng")

这篇关于从命令行调用函数时获取八度图进行绘制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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