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 certain colors in a 'for' loop
Replies: 1   Last Post: Jun 20, 2012 11:29 PM

Advanced Search

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

Posts: 11
Registered: 6/18/12
Plotting certain colors in a 'for' loop
Posted: Jun 20, 2012 10:59 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello all,

I'm still relatively new and I"m grateful for any help or suggestions you may provide!

I've made a for loop that looks like:

for i=2:8
errorbar(all_counts(:,1),all_counts(:,i),sqrt(all_counts(:,i)), 'k.' )
hold on
end

where all_counts is data (...duh, but just in case) and I'm plotting using errorbar but I'd like to be able to plot 7 sets of data (all on the same graph), each with a different AUTOMATED color. Essentially I'd like to change the <'k.'> in the code to be something like
'k.', 'r.', 'b.' ... for each loop iteration.

I feel like I need to create a string or something, but I'm not quite sure!

If I've been unclear simply ask me to repeat myself. Thank you for any help you have.

-Michael



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.