Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6699

Contours for negative and positive in ContourPlot

From Chris Young <cy56@comcast.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Contours for negative and positive in ContourPlot
Date 2011-11-24 12:09 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jalc58$sl3$1@smc.vnet.net> (permalink)

Show all headers | View raw


I got the following to plot different styles of contours for negative 
and positive values, by using RegionPlot to make separate plots.

I suppose I could use a list of contours with style directives 
included. This would be more cumbersome coding, but the current version 
is really slow to respond.

Chris Young
cy56@comcast.net


Manipulate[
 Row[
  {
   Show[
    ContourPlot[
     Sin[x y], {x, x0, x1}, {y, y0, y1},
     ColorFunction -> (Hue[#, sat, bri] &),
     ContourStyle -> {Directive[Green, Dotted, AbsoluteThickness[thick], 
        Opacity[opac]]},
     RegionFunction -> Function[{x, y}, Sin[x y] > 0]
     ],
    ContourPlot[
     Sin[x y], {x, x0, x1}, {y, y0, y1},
     ColorFunction -> (Hue[#, sat, bri] &),
     ContourStyle -> {Directive[Red, Dotted, AbsoluteThickness[thick], 
        Opacity[opac]]},
     RegionFunction -> Function[{x, y}, Sin[x y] < 0]
     ]
    ],
   
   ContourPlot3D[
    Sin[x y] == z, {x, x0, x1}, {y, y0, y1}, {z, -1, 1},
    BoxRatios -> {x1 - x0, y1 - y0, 2},
    MeshFunctions -> {#3 &},
    Lighting -> "Neutral",
    ColorFunction -> (Hue[#3, sat, bri] &)
    ]
   }
  ],
 
 {{x0, -4}, -4, 4},
 {{x1, 4}, -4, 4},
 
 {{y0, -4}, -4, 4},
 {{y1, 4}, -4, 4},
 
 
 {{thick, 1}, 0.1, 4, 0.1},
 {{n, 4}, 0, 35, 1},
 {{sat, 0.5}, 0, 1},
 {{bri, 0.5}, 0, 1},
 {{opac, 0.5}, 0, 1}
 ]

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Contours for negative and positive in ContourPlot Chris Young <cy56@comcast.net> - 2011-11-24 12:09 +0000

csiph-web