user2482876
user2482876

Reputation: 298

Manage layout of docked figures

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

Answers (3)

Thierry Dalon
Thierry Dalon

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

Sam Roberts
Sam Roberts

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

RazerM
RazerM

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 to on.
  • You cannot set the DockControls property to off.
  • 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

Related Questions