保存 Matlab 图形而不绘制它? [英] Save Matlab figure without plotting it?
本文介绍了保存 Matlab 图形而不绘制它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一种方法可以保存图形而不实际绘制它?我的意思是,假设我想保存 plot(1:10, (1:10).^2)
的图形,我可以在不显示的情况下保存它吗?
Is there a way of saving a figure plot without actually plotting it?
I mean, let's say I want to save the graph for plot(1:10, (1:10).^2)
, can I save it without showing it?
我想通过切断不必要的图形绘制来缩短运行时间(保存后无论如何都会关闭).
I want to make the run time shorter by cutting off the unnecessary plotting of the figures (those will be closed anyway after saving).
谢谢!
推荐答案
可以这样做:
set(gcf,'Visible','off');
plot((1:10),(1:10).^2);
print -dpng c:chris.png % or whatever your print command is
这篇关于保存 Matlab 图形而不绘制它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文