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


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

Color discontinuity with ColorFunction in ContourPlot

From Chris Young <cy56@comcast.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Color discontinuity with ColorFunction in ContourPlot
Date 2011-11-24 12:09 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jalc67$slk$1@smc.vnet.net> (permalink)

Show all headers | View raw


No matter how many contours I put in, I can't get a smooth match up of
colors across the vertical and horizontal axes in the 2D plot of Sin[x
y].

There's a picture at http://home.comcast.net/~cy56/ContourPlot.png and
a Mathematica notebook file at
http://home.comcast.net/~cy56/ContourPlot.nb.


Manipulate[
 Row[
  {
   Show[
    ContourPlot[
     Sin[x y], {x, x0, x1}, {y, y0, y1},
     Contours -> n,
     ColorFunction -> (Hue[0.4 #, 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},
     Contours -> n,
     ColorFunction -> (Hue[0.4 #, 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 &},
    Mesh -> n,
    Lighting -> "Neutral",
    ColorFunction -> (Hue[0.4 #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, 8}, 0, 32, 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

Color discontinuity with ColorFunction in ContourPlot Chris Young <cy56@comcast.net> - 2011-11-24 12:09 +0000

csiph-web