MathGroup Archive 2001

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

Search the Archive

Re: ListContourPlot Color


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