       two graphs have different color on surface

• To: mathgroup at smc.vnet.net
• Subject: [mg95670] two graphs have different color on surface
• From: Steven Siew <stevensiew2 at gmail.com>
• Date: Sat, 24 Jan 2009 06:20:30 -0500 (EST)

I have tried to produce a graph where the color on the surface depends
on the value of z. When I tried doing it in two different ways, the
color are different on the two graphs even though as far as I can fee
they should be the same. The code are as below

ComplexColorPlot[func_, {xmin_, xmax_}, {ymin_, ymax_},
opts___?OptionQ] := Module[{x, y},
Plot3D[Re[func[x + I y]], {x, xmin, xmax}, {y, ymin, ymax}, opts,
ColorFunction -> (ColorData["Rainbow"][
Re@func[#1 + I*#2]] &)     ]  ]

ComplexColorPlot2[func_, {xmin_, xmax_}, {ymin_, ymax_},
opts___?OptionQ] := Module[{x, y},
Plot3D[Re[func[x + I y]], {x, xmin, xmax}, {y, ymin, ymax}, opts,
ColorFunction -> (ColorData["Rainbow"][#3] &)     ]  ]

ComplexColorPlot[Sqrt, {-1, 1}, {-1, 1},
ViewPoint -> {1.227, -1.942, 3.028}, PlotPoints -> {50, 50}]

ComplexColorPlot2[Sqrt, {-1, 1}, {-1, 1},
ViewPoint -> {1.227, -1.942, 3.028}, PlotPoints -> {50, 50}]

I expect the functions ComplexColorPlot2 and ComplexColorPlot to
produce identical color graphs when given identical inputs but they
dont. And I'm at loss as to why they dont.

My ultimate objective is to have the color reflect the value of Im[func
[x+I*y]] but I'm great difficulties in achieving it.

• Prev by Date: Re: Map onto one column of a matrix
• Next by Date: Re: Extracting Graphics3D from Plots
• Previous by thread: problem with NDSolve in version 7 vs. version 6
• Next by thread: Re: two graphs have different color on surface