Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6671
| From | Chris Young <cy56@comcast.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | ContourPlot ColorFunction workaround |
| Date | 2011-11-24 11:54 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jalbaf$s7t$1@smc.vnet.net> (permalink) |
It seems to me that the ColorFunction for the 2D ContourPlot always
starts from 0 when it does scaling, whereas the one for ContourPlot3D
scales the whole range of values of the function.
At any rate, setting ColorFunctionScaling to False and then adjusting
the range of values to run from 0 (red) to 0.4 (green) got me what I
was after, red for negative values and green for positive.
http://home.comcast.net/~cy56/ContourPlot%20fixed.png
Manipulate[
ContourPlot[
Sin[x y], {x, -2 =CF=80, 2 =CF=80}, {y, -2 =CF=80, 2 =CF=80},
Contours -> n,
ContourStyle -> None,
ColorFunctionScaling -> False,
ColorFunction -> (Hue[0.4 (# + 1)/2, 0.5, 1] &)
],
{{n, 8}, 0, 32, 1}
]
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
ContourPlot ColorFunction workaround Chris Young <cy56@comcast.net> - 2011-11-24 11:54 +0000
csiph-web