Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to create figures and dock them into my main GUI figure?

Subject: How to create figures and dock them into my main GUI figure?

From: G.A.M.

Date: 27 Aug, 2007 20:15:02

Message: 1 of 10

Is it possible (and relatively easy) to create figures that
dock into a parent figure? (I don't want to dock my figures
to the Matlab workspace.)

How do I dock my own figures into a main (parent) figure?
Thanks.

Subject: How to create figures and dock them into my main GUI figure?

From: Ashwini Deshpande

Date: 7 Sep, 2007 04:26:16

Message: 2 of 10

"G.A.M. " <x0zero@gmail.com> wrote in message <favbc6
$5uj$1@fred.mathworks.com>...
> Is it possible (and relatively easy) to create figures
that
> dock into a parent figure? (I don't want to dock my
figures
> to the Matlab workspace.)
>
> How do I dock my own figures into a main (parent) figure?
> Thanks.

Hi,

I think you can use subplot command to plot multiple graphs
in same window (figure)...

If you feel this command is noe suitable for your
application give some more idea about your requirement..

Regards,
Ashwini

Subject: How to create figures and dock them into my main GUI figure?

From: G.A.M.

Date: 18 Sep, 2007 01:01:03

Message: 3 of 10

"Ashwini Deshpande" <vd.ashwini@mathworks.com> wrote in
message <fbqjt8$ea8$1@fred.mathworks.com>...
> "G.A.M. " <x0zero@gmail.com> wrote in message <favbc6
> $5uj$1@fred.mathworks.com>...
> > Is it possible (and relatively easy) to create figures
> that
> > dock into a parent figure? (I don't want to dock my
> figures
> > to the Matlab workspace.)
> >
> > How do I dock my own figures into a main (parent) figure?
> > Thanks.
>
> Hi,
>
> I think you can use subplot command to plot multiple graphs
> in same window (figure)...
>
> If you feel this command is noe suitable for your
> application give some more idea about your requirement..
>
> Regards,
> Ashwini
>

Docking is different from using subplots. I want to
programmatically create a figure (a window) and specify that
it should be docked within another figure I have created
earlier. Can Matlab do this? Thanks.

Subject: How to create figures and dock them into my main GUI figure?

From: Adam

Date: 18 Sep, 2007 12:13:15

Message: 4 of 10

"G.A.M. " <x0zero@gmail.com> wrote in message
<fcn80f$15l$1@fred.mathworks.com>...
> "Ashwini Deshpande" <vd.ashwini@mathworks.com> wrote in
> message <fbqjt8$ea8$1@fred.mathworks.com>...
> > "G.A.M. " <x0zero@gmail.com> wrote in message <favbc6
> > $5uj$1@fred.mathworks.com>...
> > > Is it possible (and relatively easy) to create figures
> > that
> > > dock into a parent figure? (I don't want to dock my
> > figures
> > > to the Matlab workspace.)
> > >
> > > How do I dock my own figures into a main (parent) figure?
> > > Thanks.
> >
> > Hi,
> >
> > I think you can use subplot command to plot multiple graphs
> > in same window (figure)...
> >
> > If you feel this command is noe suitable for your
> > application give some more idea about your requirement..
> >
> > Regards,
> > Ashwini
> >
>
> Docking is different from using subplots. I want to
> programmatically create a figure (a window) and specify that
> it should be docked within another figure I have created
> earlier. Can Matlab do this? Thanks.

use:
set(<figurename>, 'WindowStyle', 'docked')

Subject: How to create figures and dock them into my main GUI figure?

From: "G.A.M.

Date: 18 Sep, 2007 16:54:36

Message: 5 of 10

On Sep 18, 12:25 pm, "Adam " <not.my.em...@mathworks.com> wrote:
> <SNIP>
>
>
>
> > > use:
> > > set(<figurename>, 'WindowStyle', 'docked')
>
> > My understanding from reading help is that this command
> will only dock
> > a figure to the Matlab desktop. Is that correct? If I
> could pass it a
> > parent figure parameter, that might do what I need.
>
> > I want to create a main figure for my application and then
> dock my
> > other windows to MY figure. Thanks
>
> I don't have any experience using this. However...
>
> fig1 = figure;
> set(fig1, 'WindowStyle', 'docked')
>
> fig2 = figure;
> set(fig2, 'WindowStyle', 'docked')
>
> creates one figure, then docks the second with the first.
> For me it remembers the last docked configuration, not sure
> how to change that.
>
> Use get(fig1) and get(fig2) to analyze parameters if no one
> else chimes in with details

I think I found what I need:
http://xtargets.com/cms/Tutorials/Matlab-Programming/Advanced-Layout-Management-With-Handle-Graphics.html

I just found it thanks to "per isakson". I haven't tried it yet, but
it looks like exactly what I was hoping to find.

Subject: How to create figures and dock them into my main GUI figure?

From: Yair Altman

Date: 28 Sep, 2007 01:08:05

Message: 6 of 10

> > Docking is different from using subplots. I want to
> > programmatically create a figure (a window) and specify that
> > it should be docked within another figure I have created
> > earlier. Can Matlab do this? Thanks.
>
> use:
> set(<figurename>, 'WindowStyle', 'docked')


Docking figures places them in the "Figures" group
container. Here is an undocumented/unsupported hack to dock
figures into your own custom-made group. This enables
docking some figures into the "Figures" container and others
into the "myGroup" container:

desktop = com.mathworks.mde.desk.MLDesktop.getInstance;
myGroup = desktop.addGroup('myGroup');
set(get(gcf,'javaframe'), 'GroupName','myGroup');
% docking gcf will now add it to myGroup, not "Figures"

More hacks on groups (resizing, minimizing/maximizing,
docking/undocking etc.) can be found here:
http://tinyurl.com/32q6hb and: http://tinyurl.com/2xpxdp

Yair Altman
http://ymasoftware.com

Subject: How to create figures and dock them into my main GUI figure?

From: Yair Altman

Date: 13 Oct, 2007 22:06:05

Message: 7 of 10

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message
<fdhk5l$ch8$1@fred.mathworks.com>...
> > > Docking is different from using subplots. I want to
> > > programmatically create a figure (a window) and
specify that
> > > it should be docked within another figure I have created
> > > earlier. Can Matlab do this? Thanks.
> >
> > use:
> > set(<figurename>, 'WindowStyle', 'docked')
>
>
> Docking figures places them in the "Figures" group
> container. Here is an undocumented/unsupported hack to dock
> figures into your own custom-made group. This enables
> docking some figures into the "Figures" container and others
> into the "myGroup" container:
>
> desktop = com.mathworks.mde.desk.MLDesktop.getInstance;
> myGroup = desktop.addGroup('myGroup');
> set(get(gcf,'javaframe'), 'GroupName','myGroup');
> % docking gcf will now add it to myGroup, not "Figures"
>
> More hacks on groups (resizing, minimizing/maximizing,
> docking/undocking etc.) can be found here:
> http://tinyurl.com/32q6hb and: http://tinyurl.com/2xpxdp
>
> Yair Altman
> http://ymasoftware.com


For anyone interested, I recently posted a submission on the
File Exchange that handles figure docking into any Matlab or
user-defined figure-group (including odd groups like the
Matlab editor...): setFigDockGroup -
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=16650

enjoy :)

Yair Altman

Subject: How to create figures and dock them into my main GUI figure?

From: Scott Koch

Date: 26 Jan, 2008 01:34:02

Message: 8 of 10

Hi Yair -

Thanks for posting all of the information, it's quite nice to be able to dock
figures in a separate window. I'm a total java hack but I thought I might post
some useful (I think) ways I came across to manipulate the dock even further:

%Pull contianter out of desktop.
desktop.setGroupDocked('myGroup',0);

%Set into 3x3 tiled mode.
myDim = java.qwt.Dimension;
myDim.height = 3;
myDim.width = 3;

I wonder if this might be what Antonia was asking for in the blog entry you
referenced above...

Thanks

Scott

Subject: How to create figures and dock them into my main GUI figure?

From: Scott Koch

Date: 30 Jan, 2008 18:31:01

Message: 9 of 10

oupDocked('myGroup',0);
>
> %Set into 3x3 tiled mode.
> myDim = java.qwt.Dimension;
> myDim.height = 3;
> myDim.width = 3;
>

Forgot the a command:

desktop.setDocumentArrangement('myGroup',2,myDim);

scott

Subject: How to create figures and dock them into my main GUI figure?

From: Naor Movshovitz

Date: 29 Apr, 2008 12:57:01

Message: 10 of 10

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message
<fdhk5l$ch8$1@fred.mathworks.com>...
> Docking figures places them in the "Figures" group
> container...
>
Yair,
Here's a related question: I skipped a couple of releases
and am just encountering the "Figures" group container for
the first time (am now in R2008a). I would really like to
emulate the earlier behavior, i.e., figures create and STAY
in separate windows. My problem is that once you activate
the property editor, the figure becomes docked in the group
container, and STAYS docked even after closing the property
editor. Setting 'DockControls' to 'off' doesn't help, the
property editor will just set them to 'on'
and 'WindowStyle' to 'docked'. Can you think of a way
around this?
Thanks,
-naor

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us