MathGroup Archive 1999

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

Search the Archive

RE: contourplots

Laurence Lours  wrote:
Is it possible to do ContourPlots with no Shading but with a different color
for each contour line?

As other indicated you can do that with the ContourStyle option.  The
setting of this option should be a list of styles where each style is a list
in itself.  If you have contours at say 10 different levels and you provide
4 styles it will cycle through the different styles as required.  In the
example below I provide enough styles to have a different one for each
contour level. 

styles=Table[{Hue[h,1,1]},{h, 0.6, 1, 0.03}];
ContourPlot[Sin[x y],{x,-2,2},{y,-2,2},ContourShading->False,

(* Graphic not shown. *)

Notice you can also specify which contours should be used. Using the line
below you get a contour along paths where Sin[x y] is 

ContourPlot[Sin[x y],{x,-2,2},{y,-2,2},ContourShading->False,

(* Graphic not shown *)

Ted Ersek

For Mathematica tips, tricks see

  • Prev by Date: searchforperiod
  • Next by Date: Sound and Mathematica
  • Previous by thread: Re: contourplots
  • Next by thread: InputForm Query