Re: ColorFunctions again (making z=0 be different from z=1)
- To: mathgroup at smc.vnet.net
- Subject: [mg50540] Re: ColorFunctions again (making z=0 be different from z=1)
- From: "Peltio" <peltio at twilight.zone>
- Date: Thu, 9 Sep 2004 05:18:56 -0400 (EDT)
- References: <chk0cu$sj$1@smc.vnet.net>
- Reply-to: "Peltio" <peltioNOSP at Mdespammed.com.invalid>
- Sender: owner-wri-mathgroup at wolfram.com
"AES/newspost" wrote >The simple ColorFunction->Hue option in Plot3D, ContourPlot, and >DensityPlot, makes z = 0 appear the same as z = 1 (i.e., both bright >red), a situation which seems to me to make these plots confusing >and more difficult to interpret, given that "high peaks" and "sea >level valleys" may be the most interesting features of such a plot. > >Do others have any favorite, not too messy ColorFunctions that >make values near z = 0 tend toward white, or grey, or less bright, >or something so that there's a clearly unidirectional visual >effect going from values of z near 0 to those near z = 1? Black and white is elegant, isn't it? : ) So, why not to use GrayLevel ? This sets the maximum and minimum levels to different values LimitedGrayLevel[x_, maxBk_:0.3, maxWh_:0.90] := GrayLevel[maxBk + x(maxWh - maxBk)] This is the color function I used to plot fuzzy relations: FuzzyGray[x_] := LimitedGrayLevel[1 - x, 0, .9] Here are a few examples f[x_, y_] := Sin[(x^2 + y^2)]/Sqrt[(x^2 + y^2)] Block[{$DisplayFunction = Identity}, p2d = Plot[Evaluate[First[GrayLevel[1 - x]]], {x, 0, 1}, Frame -> True, PlotRange -> {0, 1}, AspectRatio -> Automatic]; p3d = Plot3D[f[x, y], {x, -4, 4}, {y, -4, 4}, ColorFunction -> (GrayLevel[1 - #] &), PlotRange -> All, PlotPoints -> 35]; ]; Show[GraphicsArray[{p2d, p3d}, PlotLabel -> "GrayLevel[1-#]"]]; Block[{$DisplayFunction = Identity}, p2d = Plot[Evaluate[First[LimitedGrayLevel[1 - x]]], {x, 0, 1}, Frame -> True, PlotRange -> {0, 1}, AspectRatio -> Automatic]; p3d = Plot3D[f[x, y], {x, -4, 4}, {y, -4, 4}, ColorFunction -> (LimitedGrayLevel[1 - #] &), PlotRange -> All, PlotPoints -> 35]; ]; Show[GraphicsArray[{p2d, p3d}, PlotLabel -> "LimitedGrayLevel[1-#]"]]; Block[{$DisplayFunction = Identity}, p2d = Plot[Evaluate[First[FuzzyGray[x]]], {x, 0, 1}, Frame -> True, PlotRange -> {0, 1}, AspectRatio -> Automatic]; p3d = Plot3D[f[x, y], {x, -4, 4}, {y, -4, 4}, ColorFunction -> FuzzyGray, PlotRange -> All, PlotPoints -> 35]; ]; Show[GraphicsArray[{p2d, p3d}, PlotLabel -> "FuzzyGray[#]"]]; Cheers, Peltio invalid address in reply-to. crafty demunging required to mail me.