MathGroup Archive 2002

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

Search the Archive

RE: Color Functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34270] RE: [mg34260] Color Functions
  • From: "David Park" <djmp at earthlink.net>
  • Date: Mon, 13 May 2002 05:54:13 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Charlie,

Here is an example:

Needs["Graphics`Colors`"]

data = Table[Sin[x ]Sin[y], {y, 0, 1, 0.05}, {x, 0, 1, 0.05}];

The graphics routine will feed a scaled "z value" between 0 and 1 to the
color function routine.

cfun[z_] :=
  Which[
    0 <= z < 0.25, LampBlack,
    0.25 <= z < 0.5, SeaGreen,
    0.5 <= z < 0.75, SpringGreen,
    0.75 <= z, Aquamarine]

ListDensityPlot[data, MeshRange -> {{0, 1}, {0, 1}}, ColorFunction -> cfun];

If you use the option ColorFunctionScaling -> False, then the graphics
routine will feed the actual value of the function to the color function.
(In this particular example there would be no difference.)

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

> From: Charlie Rosenthal [mailto:c.e.rosenthal at cox.net]
To: mathgroup at smc.vnet.net
>
> Hello,
>
> Could someone please provide an example of using an arbitray
> color function
> in a ListDensityPlot. I am currently using ColorFunction->Hue but
> don't like
> the color mapping.
>
> Many Thanks
>
> Charlie
>
>



  • Prev by Date: Limit with restrictions
  • Next by Date: RE: How to save all the preferences easily?
  • Previous by thread: Color Functions
  • Next by thread: how to change .nb color settings?