# to control the existence and distribution of meshes along x y z separately in ParametricPlot3D or SphericalPlot3D

I have a surface generated by the following code:

af = Pi/2; se = Sin[af/2] Sqrt[1 + Tan[Pi/2 - tt1]^2];
SphericalPlot3D[se, {tt1, 0, Pi}, {tt2, 0, 2 Pi},
PlotStyle -> Directive[Red, Opacity[1]], PlotPoints -> 30,
Boxed -> False, AxesOrigin -> {0, 0, 0}, AxesLabel -> {x, y, z},
TicksStyle -> Directive[FontOpacity -> 0, FontSize -> 0],
AxesStyle -> Directive[Black, 12], Lighting -> "Neutral",
MeshFunctions -> {#4 &, #3 &}, ImageSize -> 600,
PlotRange -> {{-1.5 Pi, 1.5 Pi}, {-1.5 Pi, 1.5 Pi}, {-1 Pi, 1 Pi}}]


The figure looks like this.

What I want is that the meshes about the $z$ axis to be distributed evenly, but seems the code is distributing w.r.t. my spherical parameters. I wonder how can I realize this?

Moreover, I wonder if I can control the existence and the distribution of the meshes for x,y,z, or tt1 tt2? I think I should go to the meshfunction, but didn't figure out how to use it.

• The reason that the mesh is distributed with respect to the spherical coordinate is that you told it to. When you put #4& as one of the MeshFunctions you are telling it to place mesh with respect to the $\theta$ coordinate. Look at the section on MeshFunctions in the documentation for SphericalPlot3D and you'll see this which should explain what is happening here. – Jason B. May 11 '16 at 8:10

SphericalPlot3D[se, {tt1, 0, Pi}, {tt2, 0, 2 Pi},
PlotStyle -> Directive[Red, Opacity[1]], PlotPoints -> 30,
Boxed -> False, AxesOrigin -> {0, 0, 0}, AxesLabel -> {x, y, z},
TicksStyle -> Directive[FontOpacity -> 0, FontSize -> 0],
AxesStyle -> Directive[Black, 12], Lighting -> "Neutral",
Mesh -> {Range[-Pi, Pi , 2 Pi/10]}, MeshFunctions -> { #3 &},
ImageSize -> 600, BoundaryStyle -> None,
MeshStyle -> Directive[Thick, Blue],
PlotRange -> {{-1.5 Pi, 1.5 Pi}, {-1.5 Pi, 1.5 Pi}, {-1 Pi, 1 Pi}}]


• Hi Kglr, this works perfectly, thanks a lot! – larry May 11 '16 at 2:32
• @larry, i am glad it worked for you. Thank you for the Accept, and welcome to mma.se. – kglr May 11 '16 at 2:34