Can you create frames in Figure?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Max1234
am 12 Apr. 2023
Bearbeitet: Adam Danz
am 12 Apr. 2023
Hi guys,
I have two questions:
1. I have created the following diagram and would like to put 4 diagrams in a frame so that it is easier to see which ones belong together. Is it possible to create a frame for all 4 areas, as I have done in red?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1353189/image.png)
2. is it possible to automatically save the figure as a PDF in landscape format and in A3, so that the size is automatically adjusted correctly?
Many thanks in advance!
1 Kommentar
Akzeptierte Antwort
Adam Danz
am 12 Apr. 2023
Bearbeitet: Adam Danz
am 12 Apr. 2023
This demo uses uigridlayout and uipanel to create 4 panels. Using tiledlayout, it creates 4 axes within each panel. You can set the panal background color or border color.
To create a tighter fit of the axes, set TileSpacing and Padding properties of the TiledChartLayout.
fig = uifigure();
gd = uigridlayout(fig,[2,2]);
panelHandles = gobjects(4,1);
tclHandles = gobjects(4,1);
ax = gobjects(4,4);
for i = 1:4
panelHandles(i) = uipanel(gd);
tclHandles(i) = tiledlayout(panelHandles(i),2,3);
ax(i,1) = nexttile(tclHandles(i),[1,2]);
ax(i,2) = nexttile(tclHandles(i));
ax(i,3) = nexttile(tclHandles(i),[1,2]);
ax(i,4) = nexttile(tclHandles(i));
end
Set border color of panels
set(panelHandles,'BorderColor','r','BorderWidth',2)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1353729/image.png)
Or, set border color background
set(panelHandles(1),'BackgroundColor',[.9 .5 .5])
set(panelHandles(2),'BackgroundColor',[.5 1 .8])
set(panelHandles(3),'BackgroundColor',[.8 .7 .8])
set(panelHandles(4),'BackgroundColor',[.5 .8 .9])
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1353734/image.png)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!