Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Re: contourplots

  • To: mathgroup at
  • Subject: [mg19731] Re: [mg19695] contourplots
  • From: "David Park" <djmp at>
  • Date: Mon, 13 Sep 1999 02:41:00 -0400
  • Sender: owner-wri-mathgroup at

>Hello Mathgroup,
>Is it possible to do ContourPlots with no Shading but with a different color
>for each contour line?
>Laurence Lours


Here is the code for a simple example:

f[x_, y_] := x^2 + y^2

plot1 = ContourPlot[f[x, y], {x, -5, 5}, {y, -5, 5}, 
    ContourShading -> False];

colfun[z_] := Hue[z/50]

clines = First[Graphics[plot1]] /. Line[pts_] :> 
     {colfun[f @@ pts[[1]]], Line[pts]}; 

Show[Graphics[{clines}], AspectRatio -> Automatic, Frame -> True, 
  FrameLabel -> {x, y}, PlotLabel -> f[x, y]]

I am separately sending you a notebook which illustrates it in more detail.

David Park
djmp at

  • Prev by Date: Re: Manipulating a list of pairs
  • Next by Date: Re: space disappears when printing
  • Previous by thread: contourplots
  • Next by thread: Re: contourplots