       Re: Re: Re: Scalar plot in 3D

• To: mathgroup at smc.vnet.net
• Subject: [mg96520] Re: [mg96473] Re: [mg96409] Re: Scalar plot in 3D
• From: "David Park" <djmpark at comcast.net>
• Date: Sun, 15 Feb 2009 03:22:40 -0500 (EST)
• References: <gn11bt\$7tg\$1@smc.vnet.net> <200902130841.DAA26539@smc.vnet.net> <153706.1234601261285.JavaMail.root@m02>

```Franco,

Most of the color gradient functions have a scale that goes from 0 to 1. For
precise control you can use ColorFunctionScaling -> False, and then use
Rescale on the coloring variable to make it fit that domain.

David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/

From: Franco Milicchio [mailto:franco.milicchio at gmail.com]

On Feb 13, 2009, at 9:41am, dh wrote:

> Hi Franco,
>
> here is an example where the z-value is color coded:
>
> ParametricPlot3D[{{4 + (3 + Cos[v]) Sin[u], 4 + (3 + Cos[v]) Cos[u],
>    4 + Sin[v]}}, {u, 0, 2 Pi}, {v, 0, 2 Pi},
>  ColorFunction -> Function[{x, y, z}, Hue[z]]]
>
> her another one where the distance from the origin defines the color:
>
> ParametricPlot3D[{{4 + (3 + Cos[v]) Sin[u], 4 + (3 + Cos[v]) Cos[u],
>    4 + Sin[v]}}, {u, 0, 2 Pi}, {v, 0, 2 Pi},
>  ColorFunction -> Function[{x, y, z}, Hue[Norm[{x, y, z}]]]]
>
> hope this helps, Daniel

Hi Daniel,

Thanks, that helped a lot! It is quite strage to me that ColorFunction
needs a unitary interval [0, 1], so I will scale down my domain and
then use the Nearest[] function to find the scalar value "near" to a
given point.

Thanks!

--
Franco Milicchio <franco.milicchio at gmail.com>

DiS - Dept. of Studies on Structures
DIA - Dept. of Computer Science and Engineering
University Roma Tre
http://plm.dia.uniroma3.it/milicchio/

```

• Prev by Date: Re: Re: Typesetting bug
• Next by Date: Re: Benchmark performance Under AIX
• Previous by thread: Re: Re: Scalar plot in 3D
• Next by thread: Re: Re: Re: Scalar plot in 3D