Octave(matlab),如何创建绘图而不显示?
八度问题(matlab)。在程序中,我有一个循环来绘制数据。在每个循环结束时,我将绘图保存到光盘上。在此过程中,八度绘制每个图。它减慢了这个过程。我只需要将绘图保存在光盘上。如果我无法显示它们,而只是保存,则会大大加快该过程。有没有办法将绘图绘制到处理程序而不显示它?我使用 scatter 函数来绘制。
The problem with octave(matlab). In the program I have loop where I plot data. In the end of each loop I save plots to disc. During this process octave draw each plot. It slows down the process. I need only plots to be saved on disc. If I could not display them,but just save, it would considerably accelerate the process. Is there way to draw plot to handler without displaying it? to draw I use scatter
function.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这没有用 matlab 进行测试,并且可能仅限于八度。
使用
f =figure('visible','off')
无法开箱即用。您需要选择合适的图形工具包:
默认为
fltk
,它无法在不显示绘图的情况下写入文件。但是,如果您选择 gnuplot ,它将能够写入文件而不先显示它:它不是特别快,但它不使用屏幕缓冲区或捕获鼠标,如果绘图会发生这种情况需要可见。
This is not tested with matlab, and potentially only limited to octave.
Using
f = figure('visible','off')
will not work out of the box.You need to select a proper graphics toolkit:
The default is
fltk
which cannot write to file without displaying the plot. However, if you selectgnuplot
it will be able to write to file without displaying it first:It is not particularly fast, but it doesn't use screen buffers or captures the mouse, which happens if the plot needs to be visible.
正如这个问题,我会这样做:
As answered in this question, I would do:
自使用 OSMesa 的 GNU Octave 4.0 起,GNU/Linux 就支持离屏渲染。因此,今天基本上有两种方法可以让
figure ("visible", "off");... print (...)
工作:graphics_toolkit gnuplot
如前所述Offscreen rendering is supported on GNU/Linux since GNU Octave 4.0 using OSMesa. So today there are basically two ways to get
figure ("visible", "off");... print (...)
working:graphics_toolkit gnuplot
as said before