MathGroup Archive 2001

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

Search the Archive

Re: ListContourPlot Color

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31479] Re: ListContourPlot Color
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Thu, 8 Nov 2001 04:54:12 -0500 (EST)
  • Organization: Universitaet Leipzig
  • References: <9sb4pf$gg4$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

data = Table[N[Exp[-x^2 - y^2]*x], {y, -2, 2, 0.05}, {x, -2, 2, 0.05}];

{zmin, zmax} = {Min[#], Max[#]} & [Flatten[data]];
colorf[sz_] := Module[{z}, z = (zmax - zmin)*sz + zmin;
                                           Which[
                                               z < -0.3, RGBColor[1, 0,
0],
                                              z < -0.15, RGBColor[1, 1,
0],
                                             z < 0, RGBColor[0, 1, 0],
                                             z < 0.15, RGBColor[0, 1,
1],
                                            z < 0.3, RGBColor[0, 0, 1],
                                           True, RGBColor[1, 0, 1]
                                        ]]

ListContourPlot[data, Contours -> {-0.3, -0.15, 0.15, 0.3},
           ColorFunction -> colorf]

works fine.

Regards
  Jens

Moranresearch at aol.com wrote:
> 
> Is the a way to assign specific colors to the intervals between individual
> contours?
> Thank you. John R Moran PhD,MD


  • Prev by Date: Re: FindRoot
  • Next by Date: Re: Ticks & MultipleListPlot
  • Previous by thread: Re: ListContourPlot Color
  • Next by thread: Re: ListContourPlot Color