Show separate figures next to each other, not using "subplot"
26 次查看(过去 30 天)
显示 更早的评论
Hello,
I wanted to know if there is a simple way to show multiple separate figures next to each other, without overlap. I tried using the following code:
clc;
clear;
close all;
f1 = figure('units','normalized','position',[0 0 .3 .3]);
f2 = figure('units','normalized','position',[0 0 .3 .3]);
movegui(f2,[300,0]);
f3 = figure('units','normalized','position',[0 0 .3 .3]);
movegui(f3,[600,0]);
I know that I can modify the "movegui" points, but I wanted to know if another solution exist, where I do not have to manually put in the points, and the separate figures will automatically appear next to each other without overlap.
Thanks.
0 个评论
采纳的回答
Walter Roberson
2016-12-15
"I wanted to know if there is a simple way to show multiple separate figures next to each other, without overlap."
No.
2 个评论
Walter Roberson
2016-12-15
It is not difficult to set the Position of the figures:
figs = [f1, f2, f3]; %as many as needed
nfig = length(figs);
frac = 1/nfig;
for K = 1 : nfig
old_pos = get(figs(K), 'Position');
set(figs(K), 'Position', [(K-1)*frac, old_pos(2), frac, old_pos(4)]);
end
but I would not call that "simple".
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!