Open 4 figures in 4 corners of the screen
9 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I wrote a small GUI in which a figure (which is saved on the harddisk) is loaded and you can select whether to keep or discard the figure. However, now i want to open 4 figures at the same time so you can compare the 4 figures before discarding one of them.This is the code that i am currently using. Unfortunately all the figures are loaded in the upper right corner of the screen. I was not able to distinguish between the 4 loaded figures. I also tried assigning variables like gfc1, gfc2, gfc3 and gfc4 but Matlab said i could not do this. gfc(1) turns blue in the editor (I dont know what this means but it seems important).
Hope you guys can help me!
gfc(1) = openfig([data.printlabels{i} '.fig']);
gfc(2) = openfig([data.printlabels{i+1} '.fig']);
gfc(3) = openfig([data.printlabels{i+2} '.fig']);
gfc(4) = openfig([data.printlabels{i+3} '.fig']);
set(gfc(1),'Units','pixels','Position',[ScrSize(3)/2 ScrSize(4)/2 ScrSize(3)/2 ScrSize(4)/2]);
set(gfc(2),'Units','pixels','Position',[ScrSize(3)/2 ScrSize(4) ScrSize(3)/2 ScrSize(4)/2]);
set(gfc(3),'Units','pixels','Position',[0 ScrSize(4) ScrSize(3)/2 ScrSize(4)/2]);
set(gfc(4),'Units','pixels','Position',[ScrSize(3) 0 ScrSize(3)/2 ScrSize(4)/2]);
回答(1 个)
Chad Greene
2015-6-24
Use
set(gcf(1),'units','normalized','outerposition',[0 0.5 .5 .5])
set(gcf(2),'units','normalized','outerposition',[0 0 .5 .5])
set(gcf(3),'units','normalized','outerposition',[0.5 0 .5 .5])
set(gcf(4),'units','normalized','outerposition',[0.5 0.5 .5 .5])
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!