简体   繁体   English

如何在终端的Octave中运行脚本时隐藏绘图输出?

[英]How to hide plot output when running scripts in Octave from Terminal?

I am using Octave under Ubuntu, connected by ssh from another computer. 我在Ubuntu下使用Octave,通过ssh从另一台计算机连接。 All I want to see is the scripts commands, because for the plots I save them in .png form for opening later. 我想看的就是脚本命令,因为对于这些图我将它们保存为.png格式以便稍后打开。

However, everytime I order the software to make a plot, like in: 但是,每次我订购软件制作情节时,如:

clf ();
surface (tx, ty, telog);
filename=sprintf('surfaceLOG-%04d',k);
saveas (1, filename, "png");

I obtain an ascii of the plot in the Terminal too, which doesnt let me see the previous output, like in: 我也在终端获得了一个ascii的情节,这不让我看到以前的输出,如:

+---------------------------------------------------------------+
|        +-------------------------------------+                |
|     14 |-+  |     |    |   |    |    |    |+-|     +++25      |
|        |    +     +    +   +    +    +    +  |     ++|        |
|     12 |-+                                 +-|     |||        |
|        |                                     |     ||+20      |
|        |                                     |     |||        |
|     10 |-+                                 +-|     |||        |
|        |                                     |     ||+15      |
|  y ax8s|-+                                 +-|     |||        |
|      6 |-+                                 +-|     |||        |
|        |                                     |     ||+10      |
|      4 |-+                                 +-|     |||        |
|        |                                     |     |||        |
|        |                                     |     ||+5       |
|      2 |-+  +     +    +   +    +    +    ++-|     |||        |
|        |    |     |    |   |    |    |    |  |     |||        |
|      0 +-------------------------------------+     +++        |
|        0    2     4    6   8   10   12   14                   |
+---------------------------------------------------------------+

So my question is how to supress this ascii plot output. 所以我的问题是如何压制这个ascii情节输出。

Using: 使用:

surface (tx, ty, telog,'visible','off');

does not work since it makes an empty plot in the picture file. 不起作用,因为它在图片文件中创建一个空图。

You should set the visibility of the figure before and not part of the call to surface . 您应该先设置图形的可见性,而不是调用surface The following will work (octave 3.8.2): 以下将有效(八度音程3.8.2):

graphics_toolkit gnuplot
figure ("visible", "off");
[X, Y, Z] = peaks ();
surface (X, Y, Z)
h = surface (X, Y, Z);
saveas (h, "surface.png")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM