Reputation: 298
I'm writing a program who will generate a couple of figures and I want to dock them all together. I can, to dock them, use the command:
set(fig1,'WindowStyle','docked');
set(fig2,'WindowStyle','docked');
etc.
But I can't find how to manage the layout of the figures inside the container or even the container size from the code. Is there a way to do it?
Upvotes: 3
Views: 3569
Reputation: 926
There is an undocumented way to achieve this. You can get inspiration from FileExchange: http://www.mathworks.com/matlabcentral/fileexchange/46352-editor-session-manager. This is saving the layout for the Editor Group. One could adapt for a figure group.
Upvotes: 1
Reputation: 24127
There's no documented way to programmatically set the docking group of figures.
However, I believe @Yair Altman's setFigDockGroup
, available from MATLAB Central File Exchange, enables you to do it (by manipulating undocumented properties of the figures and the MATLAB desktop).
Even if it doesn't quite do what you need, I would guess that by looking through that code you would find a way to do it (although you might need to be comfortable with a bit of Java).
Upvotes: 1
Reputation: 5492
You cannot set the Position
property when figures are docked.
From Docking Figures in the Desktop:
If WindowStyle is set to docked,
- MATLAB automatically sets
DockControls
toon
.- You cannot set the
DockControls
property tooff
.- You cannot set the figure
Position
property.
As for laying out the figures, you could use subplot to display multiple plots in one figure, which you can dock.
Upvotes: 2