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: Plot inside for loop..help needed!!!
Replies: 10   Last Post: Aug 29, 2013 7:15 AM

Advanced Search

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

Posts: 39
Registered: 12/15/06
Re: Plot inside for loop..help needed!!!
Posted: May 28, 2008 11:59 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Alex" <mammasis82@hotmail.com> wrote in message news:21707298.1211985459509.JavaMail.jakarta@nitrogen.mathforum.org...
> Hi,
>
> I would like to plot a figure and in my code the plot command is in a for loop. My problem is that I want to change the marker
> sign 'o' to an arbitrary one every time I go through the loop. In the code shown below for example, i = 1:10. I would need 10
> marker signs in this case. Is this possible?
>
> I would appreciate anyone's help.
>
> for i = 1:10
> hold on
> plot (x,y(i).T,'LineStyle',':',...
> 'Marker','o',...
> 'Color','k',...
> 'MarkerSize',5)
> end
> hold off


Try something like this:

set(gca,'LineStyleOrder',{'-*','-o','-v','-p','-^','-d'});
for i=1:10
hold on
plot(x, y(i).T, ...
'Color','k', ...
'MarkerSize',5);
end
hold off


-Mike Garrity
-The MathWorks, Inc.





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.