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:
Is it possible to make a figure contain another figure?

Subject: Is it possible to make a figure contain another figure?

From: Xu Qing

Date: 13 Jan, 2010 15:01:19

Message: 1 of 6

Hello,

I have some trouble in Matlab, and I hope get your help.

I want to make a figure contain more than one figure, just like MDI application which can be made in Visual C++ . For example, a figure called main frame window contains mangy son figures in the main frame window's client area.Can you give me possible
solutions, please?

Subject: Is it possible to make a figure contain another figure?

From: Jan Simon

Date: 14 Jan, 2010 00:13:03

Message: 2 of 6

Dear Xu Qing!

> I want to make a figure contain more than one figure, just like MDI application which can be made in Visual C++ . For example, a figure called main frame window contains mangy son figures in the main frame window's client area.Can you give me possible
> solutions, please?

You can do it manually by setting the figure positions of the child figures inside the main figure. Then it mighe be helpful to use the undocumented "OuterPosition" property of the figures.
But I do not think that this will look nice. And catching events of a moved figure is not easy, but possible with Yair's help: http://undocumentedmatlab.com/

Good luck, Jan

Subject: Is it possible to make a figure contain another figure?

From: TideMan

Date: 14 Jan, 2010 01:03:05

Message: 3 of 6

On Jan 14, 4:01 am, "Xu Qing" <nickfury...@163.com> wrote:
> Hello,
>
> I have some trouble  in Matlab, and I hope get your help.
>
> I want to make a figure contain more than one figure,  just like MDI application which can be made  in Visual C++ . For example,   a figure called main frame window contains mangy son figures in the main frame window's client area.Can you give me possible
> solutions, please?

It depends what you mean by "figure".
To me, figure means the window that the plot will appear in.
Within that window, there may be several panels containing plots, some
of which may overlap.
If this is what you mean, you can achieve this simply by using the
command axes to define the location and size of each panel. For
example:
axes('Position',[left bottom width height])
plot(t,y)

Subject: Is it possible to make a figure contain another figure?

From: Yair Altman

Date: 14 Jan, 2010 06:52:03

Message: 4 of 6

Try to see if the standard subplot function suits your needs. This may be the simplest solution.

tabdlg is a semi-documented function that presents plot axes in separate tabs, so that only one tab (plot) is visible at any one time; you may also wish to use the related uitab functino, which achieves the same thing using more streamlined GUI but uses undocumented features.

If you really must have MDI capabilities (for example, resizable/minimizable sub-windows etc.), you can create a new figures group and dock all your windows into this group. Use my setFigDockGroup utility on the File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/16650-setfigdockgroup

Yair Altman
http://UndocumentedMatlab.com

Subject: Is it possible to make a figure contain another figure?

From: Rune Allnor

Date: 14 Jan, 2010 08:11:07

Message: 5 of 6

On 14 Jan, 02:03, TideMan <mul...@gmail.com> wrote:
> On Jan 14, 4:01 am, "Xu Qing" <nickfury...@163.com> wrote:
>
> > Hello,
>
> > I have some trouble  in Matlab, and I hope get your help.
>
> > I want to make a figure contain more than one figure,  just like MDI application which can be made  in Visual C++ . For example,   a figure called main frame window contains mangy son figures in the main frame window's client area.Can you give me possible
> > solutions, please?
>
> It depends what you mean by "figure".
> To me, figure means the window that the plot will appear in.

'MDI' means 'Multiple Documents Interface'. The closest thing
in matlab, that I am aware of, is the code editor that can handle
several test files.

I suspect the answer to the OP's question might be that matlab
has no parallel to the MDI container of Visual Studio.

Rune

Subject: Is it possible to make a figure contain another figure?

From: Arwel

Date: 12 Dec, 2014 08:56:36

Message: 6 of 6

I have done this in the past, but I had to do it using a Java Swing gui, and then calling this from Matlab. It works very well, but the restriction is that you then can't use Matlab plotting, and have to use something like JFreeChart. There's an example I made here.. http://sourceforge.net/projects/rscl/ (note that I don't think it runs under R2014!)
Arwel







Rune Allnor <allnor@tele.ntnu.no> wrote in message <8c7371a0-a6ec-46c9-995d-9a5f68b0edd6@21g2000yqj.googlegroups.com>...
> On 14 Jan, 02:03, TideMan <mul...@gmail.com> wrote:
> > On Jan 14, 4:01 am, "Xu Qing" <nickfury...@163.com> wrote:
> >
> > > Hello,
> >
> > > I have some trouble  in Matlab, and I hope get your help.
> >
> > > I want to make a figure contain more than one figure,  just like MDI application which can be made  in Visual C++ . For example,   a figure called main frame window contains mangy son figures in the main frame window's client area.Can you give me possible
> > > solutions, please?
> >
> > It depends what you mean by "figure".
> > To me, figure means the window that the plot will appear in.
>
> 'MDI' means 'Multiple Documents Interface'. The closest thing
> in matlab, that I am aware of, is the code editor that can handle
> several test files.
>
> I suspect the answer to the OP's question might be that matlab
> has no parallel to the MDI container of Visual Studio.
>
> Rune

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