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: Defining and USING a color froma string
Replies: 1   Last Post: Jun 26, 2012 6:55 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
Defining and USING a color froma string
Posted: Jun 26, 2012 6:27 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello all,

Currently, in my script, I have a string (color order)

ColStr={'r.','m.','y.','w.','g.','c.','b.','k.'};

which I use in a plot like:

errorbar(all_counts(pos(:,j),1),...
all_counts(pos(:,j),i),...
sqrt(all_counts(pos(:,j),i)),...
ColStr{i})

that I'd like to have 'better' colors (like orange and a more 'pink' pink, as well as purple). I know how to say what a color is in RGB e.g. [1.0 0.4 0.6].

How do I actually DEFINE them (with the right name or cute one letter variable name instead) and then USE/CALL it in/from a string?

By the way, the string will be used with a legend to plot data with different colors.

I appreciate any input you may have. I've been googling for a while and haven't seen anything that resembles what I want....

-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.