MathGroup Archive 2002

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

Search the Archive

Re: Fill the space surrounded by two contours lines with different colors

  • To: mathgroup at smc.vnet.net
  • Subject: [mg36445] Re: Fill the space surrounded by two contours lines with different colors
  • From: Tom Burton <tburton at brahea.com>
  • Date: Sat, 7 Sep 2002 02:53:58 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello,

On 9/6/02 12:20 AM, in article al9l7i$b1l$1 at smc.vnet.net, "Jun Lin"
<jl_03824 at yahoo.com> wrote:

> I need to fill the space between two contour lines, C1 and C2, with
> red color, and leave the other place white. What trick I have to use?
> Any suggestion and advice will be appreciated.

Over the years I have alighted upon the following scheme. Suppose I want to
color only between contour levels 1 and 2:

In[84]:=Needs["Graphics`Colors`"]

In[88]:=ContourPlot[x, {x, -1, 3},   {y, 0, 1},
        Contours ->  {0, 1, 2, 3, 4},
        ColorFunction -> (If[1 < # < 2, Red, White] & ),
        ColorFunctionScaling -> False];

Hints:

1. Specify the specific contour levels instead of specifying only the count.
2. Disable ColorFunctionScaling so the argument to ColorFunction corresponds
to the contour levels.

Hope this helps,

Tom Burton



  • Prev by Date: Re: non zero result after multiplying with zero.
  • Next by Date: Re: Heat conductivity equation
  • Previous by thread: Re: Fill the space surrounded by two contours lines with different colors
  • Next by thread: RE: Fill the space surrounded by two contours lines with different colors