MathGroup Archive 2008

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

Search the Archive

Re: Colors chosen for ListPlot, etc., in v. 6 -- followup

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88916] Re: Colors chosen for ListPlot, etc., in v. 6 -- followup
  • From: Curtis Osterhoudt <cfo at lanl.gov>
  • Date: Wed, 21 May 2008 14:50:13 -0400 (EDT)
  • Organization: LANL
  • References: <200805201402.58127.cfo@lanl.gov>
  • Reply-to: cfo at lanl.gov

   Turns out that I was mostly right: the difference between the hue values is 
equal to (GoldenRatio ^3 ) -4 . Cool! Truly a maximally irrational number.

              C.O.



On Tuesday 20 May 2008 14:02:57 you wrote:
> Hi, all,
>
>    I was curious about the colors used automatically for multiple lists in
> graphics such as ListPlot. I know that it looks as though the colors are
> reused after about four datasets, but I wanted to test this, so I cobbled
> together a quick set of commands. It turns out that the colors are not
> reused, but it's hard to see on smallish plots:
>
>   (*  Create a plot with many data sets so we may include a lot of colors: 
> *)
>
> g = ListPlot[(Range[10]*#1 & ) /@ Range[10, 0.1, -0.1],
>      PlotStyle -> PointSize[0.02]]
>
>    (* A function to extract the hues returned in a graphics object:  *)
>
> ColorsFromGraphics[graphics_] := Level[Cases[graphics, __Hue, Infinity],
> {-2, -2}]
>
>     (*  colors used in our plot 'g':  *)
>
> cols = ColorsFromGraphics[g]
>
>    (* it turns out that all of the points have the same saturation and
> brightness, but many more hues appear than just four:  *)
>
> hues = cols /. Hue[a__] :> (First@{a})
>
> ListPlot[hues]
>
>    (* note that in the ListPlot of hues, the first four hues wrap around
> the range {0, 1} quite nicely, but when you get to the fifth hue, it falls
> quite close to the first one, etc. *)
>
> (* The hues have a constant offset, sequentially added, presumably so that
> they wrap around the "hue space" without repeating themselves: *)
>
>   ListPlot[Differences@hues]
>
> (* but I'm not sure where the chosen number comes from -- it looks as
> though it's chosen to be a "maximal irrational", so that the hues don't
> repeat, and the same number shows up when perusing the scientific
> literature about Hausdorff dimensions and so on in physical systems. Can
> anyone shed some light on it?  *)
>
>            Cheers,
>                            C.O.



-- 
==========================================================
Curtis Osterhoudt
cfo at remove_this.lanl.and_this.gov
PGP Key ID: 0x4DCA2A10
Please avoid sending me Word or PowerPoint attachments
See http://www.gnu.org/philosophy/no-word-attachments.html
==========================================================


  • Prev by Date: Re: DumpSave of packages
  • Next by Date: Re: Cannot NSolve a system of equations
  • Previous by thread: Re: DumpSave of packages - now it works
  • Next by thread: Colors chosen for ListPlot, etc., in v. 6