MathGroup Archive 1999

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

Search the Archive

Re: How display negative contours with dashed lines?

  • To: mathgroup at
  • Subject: [mg17052] Re: How display negative contours with dashed lines?
  • From: Paul Abbott <paul at>
  • Date: Wed, 14 Apr 1999 02:12:01 -0400
  • Organization: University of Western Australia
  • References: <7e1d1b$>
  • Sender: owner-wri-mathgroup at


> I'd like to produce contour plots for which NEGATIVE function values
> are indicated as dashed lines, while other values use solid lines.
> Can anyone suggest how I can on-the-fly specify ContourStyle options
> that will display negative contour values (say in ContourPlot or
> ListContourPlot) as *dashed* lines, via (e.g.) Dashing [or in any
> other way]?

Here is one way:

ContourPlot[x^2 - y^3, {x, -2, 2}, {y, -1, 2}, 
	ContourShading -> False, PlotPoints -> 80, 
	Contours -> {-2, -1, 0, 1}, 
	ContourStyle -> 
		{{Dashing[{0.02, 0.02}]},
		 {Dashing[{0.02, 0.02}]},

This will show the two negative contours (-2,-1) dashed, the zero
contour in Red, and the positive contour (1) in black.

Note that there needs to be a one-one correspondence between Contours
and ContourStyles for this to work.


Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia           
Nedlands WA  6907                     mailto:paul at 

            God IS a weakly left-handed dice player

  • Prev by Date: Re: shading in area
  • Next by Date: Re: How to interrupt a running evaluation in MathLink
  • Previous by thread: Re: How display negative contours with dashed lines?
  • Next by thread: semi-transparent surfaces