MathGroup Archive 2001

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

Search the Archive

Re: aesthetic ColorFunction for DensityPlots

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27797] Re: [mg27774] aesthetic ColorFunction for DensityPlots
  • From: Roberto Brambilla <rlbrambilla at cesi.it>
  • Date: Fri, 16 Mar 2001 04:37:52 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

At 04.07 14/03/01 -0500, you wrote:
>Setting ColorFunction->Hue makes for pretty density plots but it makes
>both really low and really high areas red; I'd like to distinguish between
>them.
>
>Here is how I solved that problem:
>
>ColorFunction -> (Hue[-.83 # + .67]&)
>
>It uses deep blue for low regions and bright pink for highest regions.
>
>If others have played with aesthetically pleasing ColorFunctions, I'd love
>to hear your thoughts, experiences, improvements to the above...
>
>Here is a little code snippet I used to experiment:
>
>m = -.83;
>c = .67;
>n = 30;
>ListDensityPlot[{Range[0, n], Table[Mod[i, 2]*n, {i, 0, n}]},
>    Mesh -> False,
>    ColorFunction -> (Hue[m # + c]&)];
>
>(* top row alternates between lowest and highest regions;
>   bottom row goes from lowest (left) to highest (right) *)
>
>Thanks!
>Daniel
>
>--    --    --    --    --    --    --    --    --    --    --    -- 
>Daniel Reeves               http://ai.eecs.umich.edu/people/dreeves/
>
>"That must be wonderful! I don't understand it at all."
>
>
>


Dear Daniel,
I like this (bicolor):

m=1.;(*some positive real power*)
bycolor[s_] := (ss = s^m; RGBColor[ss, 1 - ss, 1 - ss])

(*es.1*)
ListDensityPlot[{Range[0, n], Table[Mod[i, 2]*n, {i, 0, n}]},
    Mesh -> False,ColorFunction ->bycolor];

(*es.2*)
ContourPlot[E^-(x^2+y^2) ,{x,-1,1},{y,-1,1},PlotRange->All,
            ContourLines->False, ColorFunction ->bycolor];

A lot of variations on this theme.  A major difficulty is
to have the reference color-scale.
Bye, Roberto.
Roberto Brambilla
CESI
Via Rubattino 54
20134 Milano
tel +39.2.2125.5875
fax +39.2.2125.610
rlbrambilla at cesi.it



  • Prev by Date: Re: Dumb question
  • Next by Date: Re: Dumb question
  • Previous by thread: Re: aesthetic ColorFunction for DensityPlots
  • Next by thread: Re: aesthetic ColorFunction for DensityPlots