Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Getting Color *names* as strings?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67485] Re: [mg67473] Getting Color *names* as strings?
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Wed, 28 Jun 2006 03:51:30 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

You have to start with strings for the color names.

greens=Names["*Green*"];

Note that these are strings.

Plot[ x, {x,0,1}, 
        PlotStyle ->ToExpression[#],
        PlotLabel -> #]&/@greens;


Bob Hanlon

---- AES <siegman at stanford.edu> wrote: 
> Trying out different named Colors in a plot by using
> 
>    greens={CinnabarGreen, ChromeOxideGreen, CobaltGreen, etc};
> 
>    Do[ Plot[ func, range, PlotStyle -> greens[[k]],
>                     PlotLabel -> ToString[greens[[k]]] ] , 
>          {k, 1, Length[greens]} ];
> 
> Works fine -- except the PlotLabel comes out as "RGB[num, num, num]" -- 
> and using SymbolName[greens[[1]]] or even SymbolName[CinnabarGreen] does 
> _not_ give the string "CinnabarGreen".
> 
> How can I get the *name* of each color as a string to put in PlotLabel 
> or in a Text label?
> 
> (Trivial problem, I agree, but just frustrating enough to be interesting)
> 

--

Bob Hanlon
hanlonr at cox.net



  • Prev by Date: how to fit data with this specified functional form?
  • Next by Date: Re: Getting Color *names* as strings?
  • Previous by thread: how to fit data with this specified functional form?
  • Next by thread: RE: Getting Color *names* as strings?