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


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

Color discontinuity with ColorFunction in ContourPlot

Started byChris Young <cy56@comcast.net>
First post2011-11-24 12:09 +0000
Last post2011-11-24 12:09 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

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

#6700 — Color discontinuity with ColorFunction in ContourPlot

FromChris Young <cy56@comcast.net>
Date2011-11-24 12:09 +0000
SubjectColor discontinuity with ColorFunction in ContourPlot
Message-ID<jalc67$slk$1@smc.vnet.net>
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}
 ]

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web