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')
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
> > 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.
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
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
Forgot the a command:
desktop.setDocumentArrangement('myGroup',2,myDim);
scott