Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Plotting multiple 3d loops
Replies: 3   Last Post: Feb 8, 2013 8:21 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Phil

Posts: 61
Registered: 12/8/08
Re: Plotting multiple 3d loops
Posted: Feb 8, 2013 7:22 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Ulf Graewe" wrote in message <kf2pr8$hu9$1@newscl01ah.mathworks.com>...
> "Phil Roberts" wrote in message <kf2lk7$4eu$1@newscl01ah.mathworks.com>...
> > Hello,
> >
> > I have 2 datasets which I would like plot on the same graphs.
> >
> > My code is below:
> > for j = 1:2;
> > for i = 1:7;
> > for k = 1:5;
> > figure;plot(x_data(i,j,k), y_data(i,j,k));
> > end
> > end
> > end

>
> Maybe you try this:
> for j = 1:2;
> figcounter=1;
> for i = 1:7;
> for k = 1:5;
> figure(figcounter);plot(x_data(i,j,k), y_data(i,j,k));
> figcounter = figcounter + 1;
> end
> end
> end
>
> I hope this is what you are looking for.
>
> Best, ulf


Hi Ulf,

This works great when I add "hold on" on the end of the plot section of the script. Many thanks for your help.

On another note, when I am plotting multiple datasets and over laying the figures, is it possible to change the linestyle for each dataset and also add a legend for each dataset added to each figure?

Many thanks,

Phil



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.