http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431
MATLAB Central Newsreader  Plotting a graph of three variables
Feed for thread: Plotting a graph of three variables
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Sun, 29 Aug 2010 09:00:07 +0000
Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#775274
Prasad M. Rao
Hello,<br>
<br>
I would like to plot a graph of three variables,two of which would be plotted along the X & Y axis, while the third would direct the curves i.e. the third variable would plot multiple curves as functions of the variables present in X & Y.<br>
Hoping for a reply.<br>
<br>
Thanks,<br>
Prasad M. Rao.

Sun, 29 Aug 2010 10:44:03 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#775279
Ross W
"Prasad M. Rao" <XLR8RPM@Gmail.com> wrote in message <i5d7in$p17$1@fred.mathworks.com>...<br>
> Hello,<br>
> <br>
> I would like to plot a graph of three variables,two of which would be plotted along the X & Y axis, while the third would direct the curves i.e. the third variable would plot multiple curves as functions of the variables present in X & Y.<br>
> Hoping for a reply.<br>
> <br>
> Thanks,<br>
> Prasad M. Rao.<br>
<br>
Hi<br>
<br>
It's not very clear what you want.<br>
Have you looked at the contour command?<br>
<br>
Ross

Sun, 29 Aug 2010 12:38:03 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#775290
Prasad M. Rao
For example, if I'm plotting a curve of fruits vs. cost, I would get one curve.<br>
But how to plot it for say, seven days of the week, thus showing seven curves in the same graph.<br>
So if you could guide me with the codes it would be great.<br>
<br>
Thanks,<br>
Prasad M. Rao.

Sun, 29 Aug 2010 12:45:05 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#775298
David Young
Plot the first curve, then give the command "hold on" and plot the remaining curves. They will appear on the same axes. You can control the colours etc if you want to distinguish them.<br>
<br>
It's also possible to do it by putting all the data into matrices and making one call to the plot function, but you might find the first way easiest.

Sun, 29 Aug 2010 15:14:03 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#775322
Prasad M. Rao
No I've already tried the hold function, it tries to fit the data as two separate curves.<br>
What I want is the third variable to show up as different curve altogether.<br>
Just to show the trend that exists because of introduction of the third variable.<br>
<br>
Thanks,<br>
Prasad M. Rao.

Sun, 29 Aug 2010 19:45:04 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#775357
Roger Stafford
"Prasad M. Rao" <XLR8RPM@Gmail.com> wrote in message <i5dtfr$10r$1@fred.mathworks.com>...<br>
> No I've already tried the hold function, it tries to fit the data as two separate curves.<br>
> What I want is the third variable to show up as different curve altogether.<br>
> Just to show the trend that exists because of introduction of the third variable.<br>
> <br>
> Thanks,<br>
> Prasad M. Rao.<br>
         <br>
To do what you apparently want, it would be necessary to sort out the variables into separate groups in accordance with your third variable's values and to do a separate plot for each group using the hold function to combine them in a single figure. <br>
<br>
This could be done using the 'unique' and 'sort' functions as follows. Let row vectors of the three variables be called U, V, W (all of the same length.)<br>
<br>
[t,m,n] = unique(W); % Find the unique third parameter values<br>
[t,p] = sort(n); % Put indices into separate groups in p<br>
q = 1:length(p);<br>
q(p) = q; % Get the inverse of p<br>
r = [0,q(m)]; % Get indices of last members of each group<br>
hold on<br>
for k = 1:length(r)1<br>
s = p(r(k)+1:r(k+1)); % Get indices for entire kth group<br>
plot(U(s),V(s),'y') % Plot that group<br>
end<br>
hold off<br>
<br>
As David suggests, you can distinguish between the separate curves by using a 'linespec' quantity indexed for color by the index k. The above only separates them by not joining the different groups with connecting yellow lines.<br>
<br>
Roger Stafford

Mon, 30 Aug 2010 15:52:06 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#775605
Prasad M. Rao
Thanks Roger for replying.<br>
I think I'm getting there.<br>
<br>
But your code gave the following error:<br>
??? Error using ==> plot<br>
Error in color/linetype argument<br>
<br>
Also I found a graph on the internet very similar to the one I want.<br>
Its the image with the name Frame 2.<br>
Here's the link:<br>
<a href="http://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun08n.shtml">http://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun08n.shtml</a><br>
<br>
Hope you reply soon, I feel I'm getting closer.<br>
<br>
Thanks,<br>
Prasad M. Rao.

Sat, 18 Sep 2010 13:46:03 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#780462
Prasad M. Rao
Hey, I really need your help.<br>
Apologies for the delay.<br>
Lets see how helpful I cane be in my problem.<br>
I have three variables say X, Y and Z.<br>
I need to plot X vs. Y.<br>
Now the problem:<br>
1. Y is changing, so is Z.<br>
So now what I need is the graph of X vs. Y at different Z.<br>
2. Now all the variables (X,Y & Z) have thousands of values in them, but I would like the graphs at just some discrete points of Z.<br>
3. OK I know that the graph of X vs. Y is a curve. So now all I want is multiple graphs on the same page of X vs. Y at different Z.<br>
The people who know the exact code, said that I needed to use one or two for loops, the plot and the hold commands.<br>
Please need help on this.<br>
Thanks!

Sat, 18 Sep 2010 14:39:04 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#780471
Ross W
"Prasad M. Rao" <XLR8RPM@Gmail.com> wrote in message <i72fqr$gip$1@fred.mathworks.com>...<br>
> Hey, I really need your help.<br>
> Apologies for the delay.<br>
> Lets see how helpful I cane be in my problem.<br>
> I have three variables say X, Y and Z.<br>
> I need to plot X vs. Y.<br>
> Now the problem:<br>
> 1. Y is changing, so is Z.<br>
> So now what I need is the graph of X vs. Y at different Z.<br>
> 2. Now all the variables (X,Y & Z) have thousands of values in them, but I would like the graphs at just some discrete points of Z.<br>
> 3. OK I know that the graph of X vs. Y is a curve. So now all I want is multiple graphs on the same page of X vs. Y at different Z.<br>
> The people who know the exact code, said that I needed to use one or two for loops, the plot and the hold commands.<br>
> Please need help on this.<br>
> Thanks!<br>
<br>
%1000 X Y Z triplets<br>
X=rand(1000,1);<br>
Y=rand(1000,1);<br>
Z=X.*Y;<br>
<br>
%gridded z values byinterpolation<br>
xi=linspace(min(X),max(X),100);<br>
yi=linspace(min(Y),max(Y),100);<br>
z=griddata(xi,yi,X,Y,Z);<br>
<br>
%plot x Y locations with equal Z values<br>
<br>
Ross<br>
contour(xi,yi,z,10)

Sun, 19 Sep 2010 00:16:05 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#780548
Prasad M. Rao
Hey Ross, thanks for replying,<br>
<br>
I'm getting this error code, can this be solved.<br>
<br>
??? Error using ==> griddata at 53<br>
X and Y must be same length as Z or the lengths<br>
of X and Y must match the size of Z.<br>
<br>
I guess since this is accumulated data, the lengths and types of each of the variables is not matching.<br>
Can you help me out here.<br>
Thanks !

Sun, 19 Sep 2010 00:40:12 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#780551
Ross W
"Prasad M. Rao" <XLR8RPM@Gmail.com> wrote in message <i73ko5$mv0$1@fred.mathworks.com>...<br>
> Hey Ross, thanks for replying,<br>
> <br>
> I'm getting this error code, can this be solved.<br>
> <br>
> ??? Error using ==> griddata at 53<br>
> X and Y must be same length as Z or the lengths<br>
> of X and Y must match the size of Z.<br>
> <br>
> I guess since this is accumulated data, the lengths and types of each of the variables is not matching.<br>
> Can you help me out here.<br>
> Thanks !<br>
<br>
It failed because I wrote code without checking it. My mistake, sorry<br>
<br>
it was all ok except the griddata call, which should have been<br>
<br>
z=griddata(X,Y,Z,xi,yi');<br>
<br>
Ross

Sun, 19 Sep 2010 01:14:04 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#780558
Prasad M. Rao
Hey Ross, once again thanks!<br>
<br>
It worked at least the code did marvellously.<br>
But I didn't get the curves as seen when only it was X vs. Y.<br>
I think that at least the behaviour of the curve shouldn't have changed.<br>
<br>
What I would like to ask tell is this:<br>
When I said thousands of values I meant both positive and negative.<br>
The values in X are in the range from 20 to +20.<br>
So also is the range of Y from 10,000 to +10000.<br>
Also Z has values from 15,000 to +15,000.<br>
<br>
I hope you understand and can help me out here.<br>
Z cannot be generated it is already present. <br>
<br>
Also I found a graph on the internet very similar to the one I want.<br>
Its the image with the name Frame 2.<br>
Here's the link:<br>
<a href="http://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun08n.shtml">http://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun08n.shtml</a><br>
Please help! :(

Sun, 19 Sep 2010 07:20:23 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#780591
Ross W
"Prasad M. Rao" <XLR8RPM@Gmail.com> wrote in message <i73o4s$nmb$1@fred.mathworks.com>...<br>
> Hey Ross, once again thanks!<br>
> <br>
> It worked at least the code did marvellously.<br>
> But I didn't get the curves as seen when only it was X vs. Y.<br>
> I think that at least the behaviour of the curve shouldn't have changed.<br>
> <br>
> What I would like to ask tell is this:<br>
> When I said thousands of values I meant both positive and negative.<br>
> The values in X are in the range from 20 to +20.<br>
> So also is the range of Y from 10,000 to +10000.<br>
> Also Z has values from 15,000 to +15,000.<br>
> <br>
> I hope you understand and can help me out here.<br>
> Z cannot be generated it is already present. <br>
> <br>
> Also I found a graph on the internet very similar to the one I want.<br>
> Its the image with the name Frame 2.<br>
> Here's the link:<br>
> <a href="http://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun08n.shtml">http://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun08n.shtml</a><br>
> Please help! :(<br>
<br>
You said in of your comments that you want to plot XY curves for a few particualr values of Z.<br>
<br>
So how about you make a list of those Zvalues.<br>
<br>
Zlist=[2 3 4];<br>
<br>
and you also have your X, Y, Z<br>
<br>
for m=1:numel(Zlist)<br>
n=find(Z==Zlist(m));<br>
plot(X(n),Y(n))<br>
end<br>
<br>
This is a lot like what Roger suggested earlier (though his code is more efficient), but perhaps simpler for you to debug.<br>
<br>
Ross

Sun, 19 Sep 2010 13:00:06 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#780614
Prasad M. Rao
Hey Ross, thanks once again!<br>
<br>
I tried the code but it ain't workin' but Roger's ran, but its not conclusive.<br>
I beg you to please see the image, maybe it will help.<br>
The curves w.r.t. X and Y are plotted, but there are multiple ones because Z is changing too.<br>
Roger mentions something about linespec, can you enlighten me on that.<br>
These graphs are so common nowadays but so hard to get them plotted.<br>
Waiting in anticipation,<br>
Thanks.

Sun, 19 Sep 2010 21:19:04 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#780696
Ross W
"Prasad M. Rao" <XLR8RPM@Gmail.com> wrote in message <i751gm$b82$1@fred.mathworks.com>...<br>
> Hey Ross, thanks once again!<br>
> <br>
> I tried the code but it ain't workin' but Roger's ran, but its not conclusive.<br>
> I beg you to please see the image, maybe it will help.<br>
> The curves w.r.t. X and Y are plotted, but there are multiple ones because Z is changing too.<br>
> Roger mentions something about linespec, can you enlighten me on that.<br>
> These graphs are so common nowadays but so hard to get them plotted.<br>
> Waiting in anticipation,<br>
> Thanks.<br>
<br>
I saw an image showing 4 or 5 colored lines. Each line was drawn on an xy plot, and corresponded to a specific value of another variable.<br>
This code makes lines of different colors on an xy plot<br>
<br>
%X Y Z are vectors of equal length.<br>
Zlist=[2 3 4]; %sample values of interest  change to suit<br>
linecol='rgbymc';<br>
for m=1:numel(Zlist)<br>
n=find(Z==Zlist(m));<br>
plot(X(n),Y(n),linecol(m))<br>
hold on<br>
end<br>
<br>
you can read about linespec here: <a href="http://www.mathworks.com/help/techdoc/ref/linespec.html">http://www.mathworks.com/help/techdoc/ref/linespec.html</a> this is the first hit that comes up when i google 'matlab plot linespec'<br>
<br>
Ross

Fri, 01 Oct 2010 15:40:05 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#784414
Prasad M. Rao
Hey Ross I hope its not too late.<br>
<br>
I've finally got the logic required to plot my graphs.<br>
I hope you help me out now.<br>
What I'm dealing with is raw data with multiple channels, but the best part is that these channels are all recorded at the same time that means the value for X at say reading no. 12990 corresponds exactly to reading no. 12990 for Y and similarly for Z too.<br>
So what I need to do is to...<br>
FIRST, filter out data corresponding to Z equal to the value required say maybe 1.25, so since the data is continuous I filter out data for the range of Z between 1.2 & 1.3.<br>
So now I have the data for X & Y for this Z in the range (1.2, 1.3).<br>
SECOND, now I just plot the X & Y at a different colour for Z=1.25.<br>
THIRD, using the hold command I do so for as many Z values that I want thus filtering out the data as I go for each individual graph.<br>
I'm not too good with the program syntax but I'm guessing I need the for loop and the hold command along with some other commands.<br>
Hope you help me out with the codes, I'm sure this is it.<br>
Please, fingers crossed here.<br>
Thanks.

Fri, 01 Oct 2010 22:16:20 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#784529
Marc
"Prasad M. Rao" <XLR8RPM@Gmail.com> wrote in message <i84vcl$c05$1@fred.mathworks.com>...<br>
> Hey Ross I hope its not too late.<br>
> <br>
> I've finally got the logic required to plot my graphs.<br>
> I hope you help me out now.<br>
> What I'm dealing with is raw data with multiple channels, but the best part is that these channels are all recorded at the same time that means the value for X at say reading no. 12990 corresponds exactly to reading no. 12990 for Y and similarly for Z too.<br>
> So what I need to do is to...<br>
> FIRST, filter out data corresponding to Z equal to the value required say maybe 1.25, so since the data is continuous I filter out data for the range of Z between 1.2 & 1.3.<br>
> So now I have the data for X & Y for this Z in the range (1.2, 1.3).<br>
> SECOND, now I just plot the X & Y at a different colour for Z=1.25.<br>
> THIRD, using the hold command I do so for as many Z values that I want thus filtering out the data as I go for each individual graph.<br>
> I'm not too good with the program syntax but I'm guessing I need the for loop and the hold command along with some other commands.<br>
> Hope you help me out with the codes, I'm sure this is it.<br>
> Please, fingers crossed here.<br>
> Thanks.<br>
<br>
At this point, you should paste the code you have as the other posters have solved this issue.<br>
<br>
It sounds like you will can use 'find' to get your values for Z. Something like...<br>
<br>
IX = find (Z > 1.2 & Z < 1.3) % this will give you the indices where Z is between <br>
% those values<br>
Then a simple call as such<br>
X1 = X(IX);<br>
Y1 = Y(IX);<br>
gives you vectors at that corresponding Z...<br>
Lets say you have 3 Z values, then you should get X1, X2, X3 and Y1, Y2, Y3...<br>
<br>
figure(1)<br>
plot(X1, Y1,'r')<br>
hold on<br>
plot(X2, Y2,'b')<br>
hold on<br>
plot(X3, Y3,'g')<br>
hold off<br>
<br>
If you know that all of these are going to be of equal length then you could save these into matrices and use "for" loops to do this. <br>
<br>
Something like<br>
<br>
figure(1)<br>
for i = 1:3<br>
plot(X(:,i),Y(:,i),'')<br>
hold on<br>
end<br>
hold off<br>
<br>
doc find<br>
doc plot

Fri, 01 Oct 2010 22:57:04 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#784537
Ross W
"Marc " <marc.schreier@uop.com> wrote in message <i85mjk$eia$1@fred.mathworks.com>...<br>
> "Prasad M. Rao" <XLR8RPM@Gmail.com> wrote in message <i84vcl$c05$1@fred.mathworks.com>...<br>
> > Hey Ross I hope its not too late.<br>
> > <br>
> > I've finally got the logic required to plot my graphs.<br>
> > I hope you help me out now.<br>
> > What I'm dealing with is raw data with multiple channels, but the best part is that these channels are all recorded at the same time that means the value for X at say reading no. 12990 corresponds exactly to reading no. 12990 for Y and similarly for Z too.<br>
> > So what I need to do is to...<br>
> > FIRST, filter out data corresponding to Z equal to the value required say maybe 1.25, so since the data is continuous I filter out data for the range of Z between 1.2 & 1.3.<br>
> > So now I have the data for X & Y for this Z in the range (1.2, 1.3).<br>
> > SECOND, now I just plot the X & Y at a different colour for Z=1.25.<br>
> > THIRD, using the hold command I do so for as many Z values that I want thus filtering out the data as I go for each individual graph.<br>
> > I'm not too good with the program syntax but I'm guessing I need the for loop and the hold command along with some other commands.<br>
> > Hope you help me out with the codes, I'm sure this is it.<br>
> > Please, fingers crossed here.<br>
> > Thanks.<br>
<br>
A variation on my previous post ...<br>
<br>
Zlist=[1.2 1.3 1.4 ];<br>
<br>
and you also have your X, Y, Z<br>
<br>
col='rgbymck'; %a list of colours (longer than it needs to be ...)<br>
<br>
for m=1:numel(Zlist)1<br>
n=find(Z>Zlist(m) & Z<=Zlist(m+1));<br>
plot(X(n),Y(n),col(m))<br>
hold on<br>
end<br>
<br>
Ross

Sat, 02 Oct 2010 04:10:21 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#784574
Prasad M. Rao
Hey Mark your code worked great, but just one tiny problem, however I try, there are 3 separate plots on 3 graphs rather than 3 plots on the same graph.<br>
I don't know why the hold function ain't working.<br>
Please advise.<br>
<br>
Hey Ross, thanks for all the help, your code gave this error <br>
??? Error using ==> and<br>
Too many input arguments.

Sat, 02 Oct 2010 07:12:04 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#784594
Ross W
"Prasad M. Rao" <XLR8RPM@Gmail.com> wrote in message <i86bbc$sqi$1@fred.mathworks.com>...<br>
> Hey Mark your code worked great, but just one tiny problem, however I try, there are 3 separate plots on 3 graphs rather than 3 plots on the same graph.<br>
> I don't know why the hold function ain't working.<br>
> Please advise.<br>
> <br>
> Hey Ross, thanks for all the help, your code gave this error <br>
> ??? Error using ==> and<br>
> Too many input arguments.<br>
<br>
hmmmm ... maybe some missing parentheses in my for loop? I don't have matlab with me now, so perhaps you can try to sort it out if it fails again?<br>
<br>
Zlist=[1.2 1.3 1.4 ];<br>
<br>
col='rgbymck'; %a list of colours (longer than it needs to be ...)<br>
<br>
for m=1:(numel(Zlist)1)<br>
n=find(Z>Zlist(m) & Z<=Zlist(m+1));<br>
plot(X(n),Y(n),col(m))<br>
hold on<br>
end<br>
<br>
Ross

Sun, 03 Oct 2010 04:32:03 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#784738
Marc
"Prasad M. Rao" <XLR8RPM@Gmail.com> wrote in message <i86bbc$sqi$1@fred.mathworks.com>...<br>
> Hey Mark your code worked great, but just one tiny problem, however I try, there are 3 separate plots on 3 graphs rather than 3 plots on the same graph.<br>
> I don't know why the hold function ain't working.<br>
> Please advise.<br>
> <br>
> Hey Ross, thanks for all the help, your code gave this error <br>
> ??? Error using ==> and<br>
> Too many input arguments.<br>
<br>
As I said, POST YOUR CODE....<br>
<br>
I get paid $80 per hour and at this point without your code I could care less.

Sun, 03 Oct 2010 06:36:03 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#784750
Prasad M. Rao
@ Mark: Here's the code, it's just your code.<br>
<br>
IX1 = find (LS > 0 & LS < 1.0) <br>
X1 = SM(IX1);<br>
Y1 = FB(IX1);<br>
figure(1)<br>
plot(X1, Y1,'r')<br>
hold on<br>
<br>
IX2 = find (LS > 1 & LS < 2.0)<br>
X2 = SM(IX2);<br>
Y2 = FB(IX2);<br>
figure(2)<br>
plot(X2, Y2,'b')<br>
hold on<br>
<br>
IX3 = find (LS > 2 & LS < 3.0)<br>
X3 = SM(IX3);<br>
Y3 = FB(IX3);<br>
figure(3)<br>
plot(X3, Y3,'g')<br>
hold off<br>
<br>
Hoping for a reply.<br>
Thanks.

Sun, 03 Oct 2010 13:48:59 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#784789
dpb
Prasad M. Rao wrote:<br>
> @ Mark: Here's the code, it's just your code.<br>
> <br>
> IX1 = find (LS > 0 & LS < 1.0) X1 = SM(IX1);<br>
> Y1 = FB(IX1);<br>
> figure(1)<br>
...<br>
> figure(2)<br>
> plot(X2, Y2,'b')<br>
> hold on<br>
...<br>
> figure(3)<br>
> plot(X3, Y3,'g')<br>
> hold off<br>
> <br>
> Hoping for a reply.<br>
> Thanks.<br>
<br>
Well, you could have done last time and at least one would think you <br>
could spell Marc's name correctly.<br>
<br>
If you're going to specify a unique figure number before each plot(), of <br>
course you're going to get a new figure...don't do that.<br>
<br>


Tue, 26 Oct 2010 13:07:03 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#790673
Prasad M. Rao
Thankyou very much for all the help Marc & dpb.<br>
But I guess my last question could be how to filter data for a specific value rather than the range specified in the above codes.<br>
But a hearty thanks to all none the less.<br>
Thanks.

Tue, 26 Oct 2010 13:17:02 +0000
Re: Plotting a graph of three variables
http://www.mathworks.com/matlabcentral/newsreader/view_thread/290431#790677
dpb
Prasad M. Rao wrote:<br>
...<br>
> But I guess my last question could be how to filter data for a specific <br>
> value rather than the range specified in the above codes.<br>
...<br>
<br>
Write the condition you're interested...find() works w/ "==" as well as <br>
inequalities or you can use logical addressing.<br>
<br>
Nota Bene howeverwhen you ask for exact equality of floating point <br>
values, that's what you get. You'll probably want to build in some <br>
tolerance or the results may be your followup question.<br>
<br>
Search the archives and the TMW Matlab wiki; it's a FAQ...<br>
<br>
