Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在不实际绘制图形的情况下保存图形?我的意思是,假设我想保存图表plot(1:10, (1:10).^2),我可以在不显示的情况下保存它吗?
plot(1:10, (1:10).^2)
我想通过切断不必要的图形绘图来缩短运行时间(保存后无论如何都会关闭)。
谢谢!
可以这样做:
set(gcf,'Visible','off'); plot((1:10),(1:10).^2); print -dpng c:\chris.png % or whatever your print command is
还有saveas(h,'filename.ext')可以将图形保存为某些格式的功能。
saveas(h,'filename.ext')