Create and save figure without drawing
34 次查看(过去 30 天)
显示 更早的评论
I would like to create figures within a script without actually drawing them, on the assumption that this will save time, RAM, and GPU resources. I would like to save those objects as pictures. However, each figure is a layering of two different datasets. In an interactive setting I would achieve this through the hold on command
A = randi(9,1,15);
B = randi(9,1,15);
MyScatter = scatter([1:15],A)
hold on
MyScatter = scatter([1:15],B)
But this still creates a figure window and draws the objects to the screen.
Is there a way to do what I describe, perhaps via copyobj? And/or am I unlikely to see significant computational savings by doing so?
0 个评论
采纳的回答
Mahdi Hayati
2022-9-24
To save figure as picture in your system, without actually showing the figure, first make your figure invisible:
f = figure('visible','off');
then go for your scatter and add them to the ' f ' which is your invisible figure.
3 个评论
Walter Roberson
2022-9-26
Layout will not always work until the object is rendered. For example tick labels might not be correct if adding an additional component resized an axes (resizing can affect number of ticks generated)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!