Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How can I plot multiple graphs on the same single plot using GUI?
Date: Tue, 18 Nov 2008 16:19:02 +0000 (UTC)
Organization: NUS
Lines: 33
Message-ID: <gfuptm$ihj$1@fred.mathworks.com>
References: <gfrv91$cep$1@fred.mathworks.com> <gfs0bb$quv$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227025142 18995 172.30.248.37 (18 Nov 2008 16:19:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 18 Nov 2008 16:19:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1564878
Xref: news.mathworks.com comp.soft-sys.matlab:501468

"Johan Carlson" <Johan.E.Carlson@gmail.com> wrote in message <gfs0bb$quv$1@fred.mathworks.com>...
> "Bernard Lee" <leeshijun@gmail.com> wrote in message <gfrv91$cep$1@fred.mathworks.com>...
> > I have three radio buttons, each plots a single graph. 
> > for eg. 1st radio button -> a V graph
> >           2nd radio button -> a D graph
> >           3rd radio button -> a S graph 
> > How can I plot multiple graphs on the same single plot using GUI?
> > for eg. if i select the 1st and 3rd radio button, i will get the V and S graphs on the     
> >           same plot
> >           if i select the 2nd and 3rd radio button, i will get the D and S graphs on the 
> >           same plot.
> > 
> > Can you help me with ideas to create such radiobuttons as well as display using plot command. thanks alot.
> 
> Hi,
> 
> What you need to do is to get a handle to the axes of your plot. For example, when you create the first plot (or the axes) you can set the 'Tag' property, by writing
> 
> set(gca,'Tag','myplotaxes');
> 
> Then, in the callback of your radio buttons, do something like:
> 
> axes(findobj('Tag','myplotaxes'));
> hold on;
> plot(....)
> 
> If I understand your problem correctly, something like this should do the trick...
> 
> /JC

Hi JC, 

Your method solved my problem...but now i dont know how to update the legend of the graph.