Thread Subject: Will subplot work for uipanel?

Subject: Will subplot work for uipanel?

From: G.A.M.

Date: 27 Aug, 2007 19:50:06

Message: 1 of 3

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

Subject: Will subplot work for uipanel?

From: Steven Lord

Date: 27 Aug, 2007 20:28:15

Message: 2 of 3


"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


Subject: Will subplot work for uipanel?

From: G.A.M.

Date: 27 Aug, 2007 20:42:50

Message: 3 of 3

Thank you. This works for me too. Now I just wish I could
find that earlier incorrect message I read on this newsgroup
to add a correction to it...

"Steven Lord" <slord@mathworks.com> wrote in message
<favc4v$p9b$1@fred.mathworks.com>...
>
> "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
>
>

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
subplot G.A.M. 27 Aug, 2007 15:50:25
uipanel G.A.M. 27 Aug, 2007 15:50:25
figures G.A.M. 27 Aug, 2007 15:50:25
gui G.A.M. 27 Aug, 2007 15:50:25
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com