Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Re: ColorFunctions again (making z=0 be different from z=1)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50593] Re: ColorFunctions again (making z=0 be different from z=1)
  • From: "Peltio" <peltio at twilight.zone>
  • Date: Sat, 11 Sep 2004 06:45:00 -0400 (EDT)
  • References: <chk0cu$sj$1@smc.vnet.net> <chpa0a$jsl$1@smc.vnet.net> <chroci$50m$1@smc.vnet.net>
  • Reply-to: "Peltio" <peltioNOSP at Mdespammed.com.invalid>
  • Sender: owner-wri-mathgroup at wolfram.com

"AES/newspost" wrote

>But color adds something also.
>Would you have offhand a way to define a
>
>    RedLevel
>
>that goes from white for z=0 to brightest red for z=1?

I would suggest moving along the saturation direction with lightness set to
the maximum value in

    Hue[h, s, l]

The first parameter in hue allows you to select the desired hue: 0 and 1 are
red, 0.84 is violet, 0.33 is green and so on... You might want to choose a
different value for the last parameter (lightness). Here's the
'plain red' version:

    RedLevel[x_, maxBk_:0.1, maxWh_:1] :=
        Hue[1, maxBk + x(maxWh - maxBk), 1]

    f[x_,y_]:=Sin[x^2+y^2]/(x^2+y^2)

    Plot3D[f[x, y], {x, -4, 4}, {y, -4, 4}, ColorFunction ->RedLevel,
        PlotRange -> All, PlotPoints -> 35];

We can define a function

     WhiteToColor[h_][x_, maxBk_:0, maxWh_:1] :=
        Hue[h, maxBk + x(maxWh - maxBk), 1]

So that we can choose which hue to use in this way:

    Plot3D[f[x, y], {x, -4, 4}, {y, -4, 4},
        ColorFunction ->WhiteToColor[.84],
        PlotRange -> All, PlotPoints -> 35];

But I prefer to use a simple function like this:

       Jungle = RGBColor[1 - #, #, 0.74] &

    Plot3D[f[x, y], {x, -4, 4}, {y, -4, 4},
        ColorFunction ->Jungle,
        PlotRange -> All, PlotPoints -> 35];

Hope this helps,
Peltio
invalid address in reply-to. crafty demunging required to mail me






  • Prev by Date: Re: Re: Can't get graph to display when using ImplicitPlot!
  • Next by Date: Trying to eliminate a loop
  • Previous by thread: Re: ColorFunctions again (making z=0 be different from z=1)
  • Next by thread: Re: ColorFunctions again (making z=0 be different from z=1)