Organize several figures using tabs or docked figure
93 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am looking for a way to organize several figures within two tabbed or docked figures. I have two functions, func1 and func2, which are each called several times (~20x) within a script. A figure with a simple plot(x,y) is generated for each run of each function, i.e. 20 figures from func1 and 20 figures from func2. I would like to consolidate these 40 figures into just two figures, one for each function. Currently, the figures are generated and visibility is set on within the functions, but I can easily pass the handles into the main workspace as outputs if required.
I haven't had much success with the uitabgroup, but would be open to suggestions. I've also tried using the docking feature (shown below) but have not been able to generate two individual docked figures.. I end up with a docked-figure containing Figures 1, 2, and 4, while Figure 3 is a "free" window. Any information on how to generate a docked figure which isn't docked to the main Matlab window is also welcomed!
set(0,'DefaultFigureWindowStyle','normal');
h1 = figure;
h2 = figure;
set(h1,'WindowStyle','docked');
set(h2,'WindowStyle','docked');
set(0,'DefaultFigureWindowStyle','normal')
h3 = figure;
h4 = figure;
set(h4,'WindowStyle','docked');
1 comentario
Aaron Corcoran
el 1 de Nov. de 2019
Hi Kristin,
before this line: set(h4, 'WindowStyle', 'docked');
put this line: set(h3, 'WindowStyle', 'docked');
I hope this helps!
Respuestas (1)
Sean de Wolski
el 6 de Jul. de 2015
You just need to add tabs to the tab group. Here is an example not changing any titles/labels/sizes etc.
tg = uitabgroup; % tabgroup
for ii = 1:20
thistab = uitab(tg); % build iith tab
axes('Parent',thistab); % somewhere to plot
plot(rand(1,100));
end
Ver también
Categorías
Más información sobre Data Exploration en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!