The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

Posts: 12
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

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.


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.