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 5

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 5


"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 5

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
>
>

Subject: Will subplot work for uipanel?

From: Karen

Date: 27 Oct, 2010 08:04:05

Message: 4 of 5

"G.A.M. " <x0zero@gmail.com> wrote in message <favd0a$amh$1@fred.mathworks.com>...
> 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
> >
> >
>


I had wrote this to test the uipanel, but it doesn't work.

function pushbutton3_Callback(hObject, eventdata, handles)

I = imread('C:\Users\ABC\Desktop\Stroke\1A','jpg');
h = subplot(m,n,p,'Parent','handles.uipanel1');
imshow(I);
May I know what's the problem for this coding?

Thank you in advance.
Karen

Subject: Will subplot work for uipanel?

From: Steven_Lord

Date: 27 Oct, 2010 14:10:52

Message: 5 of 5



"Karen " <shinjye88@hotmail.com> wrote in message
news:ia8mdl$gb$1@fred.mathworks.com...

Rather than resurrecting a thread that's over three years old, please start
a new thread for a new issue.

*snip*

> I had wrote this to test the uipanel, but it doesn't work.
>
> function pushbutton3_Callback(hObject, eventdata, handles)
>
> I = imread('C:\Users\ABC\Desktop\Stroke\1A','jpg');
> h = subplot(m,n,p,'Parent','handles.uipanel1');

Get rid of the quotes around 'handles.uipanel1'. You want to pass the
actual handle into SUBPLOT, not a string containing the name of the struct
field containing the handle.

> imshow(I);
> May I know what's the problem for this coding?

No, because you haven't told us what "it doesn't work" means. Does it
error? Warn? Display the image incorrectly? Without that information (and
the FULL EXACT text of the error/warning message if one appears) there's NO
WAY anyone can offer any but the most general of suggestions.

Why don't you just put an axes (or multiple axes) on the uipanel in GUIDE
itself?

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.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

Contact us at files@mathworks.com