MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: two graphs have different color on surface

  • To: mathgroup at smc.vnet.net
  • Subject: [mg95710] Re: two graphs have different color on surface
  • From: Steven Siew <stevensiew2 at gmail.com>
  • Date: Sun, 25 Jan 2009 06:53:32 -0500 (EST)
  • References: <gleth7$4pe$1@smc.vnet.net>

Thanks to everyone who had reply to my query. Especially to Jean-Marc
and David Park.

It seems my mistake is not to take into account the ColorFunctionScale-
>False option and to do manual rescaling.

I have the following functions

I have ComplexColorPlotReIm which shows the Re value via the vertical
Z value and the Im value via the color. This allows me to "see" the
complex values on a single graph.


ComplexColorPlotReRe[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] &)     ]  ]

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

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

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

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

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


  • Prev by Date: Re: Problem with spline function object in Mathematica 6
  • Next by Date: Re: two graphs have different color on surface
  • Previous by thread: two graphs have different color on surface
  • Next by thread: Re: two graphs have different color on surface