Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

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

Search the Archive

Re: color surface according to absolut value of the gradient

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131460] Re: color surface according to absolut value of the gradient
  • From: conrad.clausz at gmail.com
  • Date: Wed, 10 Jul 2013 03:36:15 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20130708082302.A7B1B69DC@smc.vnet.net> <krgbh0$nvb$1@smc.vnet.net>

Thanks Bob, this did the trick. In my original data I had to rescale the range but then it worked perfectly.

Conrad

Am Dienstag, 9. Juli 2013 08:44:48 UTC+2 schrieb Bob Hanlon:
> Use ColorFunctionScaling -> False:
> 
> 
> 
> 
> 
> ListPlot3D[data,
> 
>  ColorFunction -> (ColorData["Rainbow"][
> 
>      Sqrt[D[f[x, #2], x]^2 + D[f[#1, y], y]^2] /.
> 
>       {x -> #1, y -> #2}] &),
> 
>  ColorFunctionScaling -> False]
> 
> 
> 
> 
> 
> 
> 
> Bob Hanlon
> 
> 
> 
> 
> 
> 
> 
> 
> 
> On Mon, Jul 8, 2013 at 4:23 AM, <conrad.clausz at gmail.com> wrote:
> 
> 
> 
> > I have a set of data, let's say
> 
> >
> 
> > data = Flatten[
> 
> >    Table[{i, j,
> 
> >      Sin[i] Cos[
> 
> >        j]}, {i, -\[Pi], \[Pi], .25}, {j, -\[Pi], \[Pi], .25}], 1];
> 
> >
> 
> > If I plot this, everything is fine. To get the derivatives I interpolated
> 
> > the set of data
> 
> >
> 
> > f = Interpolation[data];
> 
> >
> 
> > If I then plot the absolute value of the gradient in the same range it
> 
> > also looks correct.
> 
> >
> 
> > ListPlot3D[
> 
> >  Flatten[Table[{i, j,
> 
> >     Sqrt[D[f[x, y], x]^2 + D[f[x, y], y]^2] /. {x -> i,
> 
> >       y -> j}}, {i, -\[Pi], \[Pi], .25}, {j, -\[Pi], \[Pi], .25}], 1]]
> 
> >
> 
> > Now I want to plot the original data with the surface colored according to
> 
> > the values of the last plot. I tried
> 
> >
> 
> > ListPlot3D[data,
> 
> >  ColorFunction -> (ColorData["Rainbow"][
> 
> >      Sqrt[D[f[x, #2], x]^2 + D[f[#1, y], y]^2] /. {x -> #1,
> 
> >        y -> #2}] &)]
> 
> >
> 
> > but the result is definitely off. What am I making wrong?
> 
> >
> 
> > Thanks in advance,
> 
> > Conrad
> 
> >
> 
> >




  • Prev by Date: Re: Multiple Line coloring and Dashing in ListPlot
  • Next by Date: Re: Omega tau podcasts on Wolfram|Alpha and Methematica
  • Previous by thread: Re: color surface according to absolut value of the gradient
  • Next by thread: Omega tau podcasts on Wolfram|Alpha and Methematica