保存Matlab图而不绘图吗? [英] Save Matlab figure without plotting it?

查看:96
本文介绍了保存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屋!

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