       Re: Contour ColorFunction in a ParametricPlot

• To: mathgroup at smc.vnet.net
• Subject: [mg120111] Re: Contour ColorFunction in a ParametricPlot
• From: Heike Gramberg <heike.gramberg at gmail.com>
• Date: Fri, 8 Jul 2011 04:55:44 -0400 (EDT)
• References: <201107071133.HAA15427@smc.vnet.net>

```I'm not sure if this is what you're asking for, but you could play around with Mesh and MeshFunctions. For example

With[{meshn = 10, fmin=-1, fmax=1},
ParametricPlot3D[{Cos[\[Phi]] Sin[\[Theta]],
Sin[\[Phi]] Sin[\[Theta]], Cos[\[Theta]]}, {\[Phi], 0,
2 \[Pi]}, {\[Theta], 0, \[Pi]}, PlotPoints -> 100,
MeshFunctions ->
Function[{x, y, z, \[Phi], \[Theta]}, Sin[6 \[Phi]] Sin[6 \[Theta]]],
Mesh -> {Table[{i, Hue[Rescale[i, {fmin, fmax}]]}, {i, fmin, fmax, 2/meshn}]},
Lighting -> {{"Ambient", White}}]]

This draws meshn contours of Sin[6 \[Phi]] Sin[6 \[Theta]  between fmin and fmax where the colour of each contour
depends on its value.

Heike

On 7 Jul 2011, at 12:33, Blandeau M.N. wrote:

> Hello,
> I looked for this specific question in the archive and I did not find.
>
> I want to create a contour (ie. not smooth) ColorFunction over a parametricplot.
>
> For example:
> ParametricPlot3D[ {Cos[ \[Phi]] Sin[\[Theta]],
>  Sin[\[Phi]] Sin[\[Theta]], Cos[\[Theta]]}, {\[Phi], 0,
>  2 \[Pi]}, {\[Theta], 0, \[Pi]}, PlotPoints -> 100, Mesh -> None,
> ColorFunction ->
>  Function[{x, y, z, \[Phi], \[Theta]},
>   Hue[Sin[6 \[Phi]] Sin[6 \[Theta]]]], ColorFunctionScaling -> True]
>
> Here the colorfunction is smooth, what directive should I add to obtain a contour of the colour and to manage the number of contours ?
>
>
> Mathias Blandeau
>
>
> From: Blandeau M.N.
> Sent: 06 July 2011 14:35
> To: 'mathgroup at smc.vnet.net'
> Subject: subscription to mathgroup mailing list
>
> Hi,
> I would like to be added to the mathgroup mailing list, I am using Mathematica for my PhD and I have several questions to ask.