generating mutiple tiled figures

11 ビュー (過去 30 日間)
Rushan
Rushan 2025 年 10 月 8 日
回答済み: Rushan 2025 年 10 月 17 日
currently I get this from the code, 4 figures docked in a general figure editing window.
However what I want is this:
4 figures in a 2x2 grid.
I have tried subplots, this doesnt work since I am loading a viewer3d into them later, I really need all 4 windows to be full figures, and not just plot.
I know this must be doable, since volumeviewer (app from image processing toolbox) does this, but is there any way to do this with out creating an app? I have also tried the very old method where you group the figures, but that also didn't work.

採用された回答

Rushan
Rushan 2025 年 10 月 17 日
I HAVE FOUND A SOLUTION!!!
what you can do is use a combination of uigridlayout and ui panels, to create the tiled layout yourself
fig=figure('Name',"4 images in a tiled layout",'Position',[0 0 1920 1020]);%[0 0 1920 1020] full screen size?
g=uigridlayout(fig,[2 2]);
p_1=uipanel(g,"Title",'Data to display top left','BackgroundColor',"White");
p_1.Layout.Row=1;
p_1.Layout.Column = 2;
p_2=uipanel(g,"Title",'Data to display top right','BackgroundColor',"White");
p_2.Layout.Row=1;
p_2.Layout.Column = 2;
p_3=uipanel(g,"Title",'Data to display bottom left','BackgroundColor',"White");
p_3.Layout.Row=2;
p_3.Layout.Column = 1;
viewer=viewer3d(g,BackgroundColor='#070fad',BackgroundGradient='off',Box="on");
viewer.Layout.Row=2;
viewer.Layout.Column = 2;
volume_data=rand(10,10,10);
volshow(volume_data,Parent=viewer); %volume data is a Matrix of MxNxZx3
figure_data=rand(10,10,20);
slicers_xy=sliceViewer(figure_data,Parent=p_1); % figure data is a Matrix of MxNxZ

その他の回答 (1 件)

Anjaneyulu Bairi
Anjaneyulu Bairi 2025 年 10 月 16 日
編集済み: Anjaneyulu Bairi 2025 年 10 月 16 日
Hi,
You can move them in 2*2 grid by using "Tile All" option in "Layout" Tab.
Attaching picture for reference:
  1 件のコメント
Rushan
Rushan 2025 年 10 月 16 日
yes, I know this, but I want the code to do that for me. I was wondering if that is possible?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

製品


リリース

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by