MathGroup Archive 2012

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

Search the Archive

Re: color function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128371] Re: color function
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Wed, 10 Oct 2012 01:26:53 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20121009043807.A9EB96886@smc.vnet.net>

http://reference.wolfram.com/mathematica/ref/ColorFunctionScaling.html

f[x_, y_] = Cos[x] + Cos[y];

cfun[z_] := Which[z < 1, Hue[.12], True, Hue[.63]]

ContourPlot[f[x, y], {x, -10, 10}, {y, -10, 10},
 ColorFunction -> cfun,
 ColorFunctionScaling -> False]


Bob Hanlon


On Tue, Oct 9, 2012 at 12:38 AM, Rick C <rick.cangelosi at gmail.com> wrote:
> Hello:
>
> I am working with a contour plot and I am difficulty creating a color function which, for example, will color regions on the plane Blue where if z < 1 and color regions on the plane Brown if z >= 1.  I tried
>
> ContourPlot[f[x, y], {x, -10, 10}, {y, -10, 10}, ColorFunction -> cfun]
>
> where
>
> cfun[z_] := Which[z < 1, Hue[.12], z >= 1, Hue[.63]]
>
> Thanks in advance for any help you can provide.
>



  • Prev by Date: Re: SatisfiabilityInstances[] how to put variables
  • Next by Date: Re: Suppress Resizing in Manipulate[expr].
  • Previous by thread: Re: color function
  • Next by thread: Re: color function