Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Will subplot work for uipanel?
Date: Mon, 27 Aug 2007 16:28:15 -0400
Organization: The MathWorks, Inc.
Lines: 36
Message-ID: <favc4v$p9b$1@fred.mathworks.com>
References: <fav9te$p6a$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1188246495 25899 144.212.105.187 (27 Aug 2007 20:28:15 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 27 Aug 2007 20:28:15 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
Xref: news.mathworks.com comp.soft-sys.matlab:425811




"G.A.M. " <x0zero@gmail.com> wrote in message 
news:fav9te$p6a$1@fred.mathworks.com...
>I want to create multiple plots inside a specific area of a
> figure. I am attempting to do that by using a uipanel and
> subplot. However, in these newsgroups I saw a message that
> someone was having trouble getting subplot to work with a
> uipanel. Is it possible to use subplot on a uipanel?
>
> If not, what is a better (easier) way to create a variable
> number of plots in a certain area of a figure?
>
> Maybe I could use docking somehow... this is all new to me,
> so any suggestions are appreciated. Thanks

Using the first two lines of the example in the UIPANEL reference page:

http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/uipanel.html

h = figure;
hp = uipanel('Title','Main Panel','FontSize',12,...
             'BackgroundColor','white',...
             'Position',[.25 .1 .67 .67]);

sp1 = subplot(2, 2, 1, 'Parent', hp);
plot(1:10);
sp4 = subplot(2, 2, 4, 'Parent', hp);
surf(peaks);

I tested this in MATLAB 7.4 (R2007a) and it worked fine.

-- 
Steve Lord
slord@mathworks.com