number of figure windows that are currently open?
20 次查看(过去 30 天)
显示 更早的评论
In a script can I get the number of figure windows that are currently open?
Why?: as I re-run the script over and over to generate another figure, I'd like to position each new figure incrementally to the right
0 个评论
采纳的回答
Bora Eryilmaz
2022-12-8
编辑:Bora Eryilmaz
2022-12-8
f1 = figure;
f2 = figure;
F = findobj('Type', 'figure')
n = numel(F)
0 个评论
更多回答(1 个)
Daniel Vieira
2022-12-8
I do something like this:
for k=1:K
% my code here
figure;
% my plot here
fig=gcf; % get figure handle
fig.Position=[50+10*k 50+10*k fig.Position(3:4)]; % puts 1st image in pixel [50 50], second in [60 60], etc
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!