Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*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 smc.vnet.net
  • Subject: [mg19731] Re: [mg19695] contourplots
  • From: "David Park" <djmp at earthlink.net>
  • Date: Mon, 13 Sep 1999 02:41:00 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

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

Laurence,

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 earthlink.net
http://home.earthlink.net/~djmp/




  • 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