Re: How display negative contours with dashed lines?
- To: mathgroup at smc.vnet.net
- Subject: [mg17052] Re: How display negative contours with dashed lines?
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Wed, 14 Apr 1999 02:12:01 -0400
- Organization: University of Western Australia
- References: <7e1d1b$bd6@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
WOOD DAVID M wrote: > 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}]}, {Hue[0]}, {GrayLevel[0]}}]; 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. Cheers, Paul ____________________________________________________________________ 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 physics.uwa.edu.au AUSTRALIA http://www.physics.uwa.edu.au/~paul God IS a weakly left-handed dice player ____________________________________________________________________