0
$\begingroup$

This code generates a nice sphere with distorted mesh lines, in the sense that they are not smooth enough. One can clearly see many disjoint lines trying to imitate a curve. I would like a smoothened curve instead for this particular mesh setup.

ParametricPlot3D[{Cos[\[Phi]] Sin[\[Theta]], Sin[\[Phi]] Sin[\[Theta]], Cos[\[Theta]]}, {\[Phi], 0, 2 \[Pi]}, {\[Theta], 0, \[Pi]}, Mesh -> 6, BoundaryStyle -> Black, PlotRange -> ConstantArray[{-1.1, 1.1}, 3], PlotStyle -> {Opacity[0.2]}, ImageSize -> Large]

Any hint is appreciated.

$\endgroup$
9
  • $\begingroup$ Increase the value of Mesh. $\endgroup$ Mar 31 '20 at 9:53
  • $\begingroup$ @HenrikSchumacher, that would increase the number of curves, instead of the quality of each curve. I am sorry if that was not clear from the question. $\endgroup$
    – exp ikr
    Mar 31 '20 at 9:55
  • $\begingroup$ Well, it does both. I am still figuring out how to do one one thing of the two... $\endgroup$ Mar 31 '20 at 9:56
  • $\begingroup$ @Nasser, I really want only these many lines otherwise when I add more details to my plot it will look clumsy. Is there any way to increase the quality? $\endgroup$
    – exp ikr
    Mar 31 '20 at 9:56
  • 2
    $\begingroup$ Okay, you can leave Mesh - > 6 and add something like PlotPoints -> 50. $\endgroup$ Mar 31 '20 at 9:57
0
$\begingroup$

As Henrik Schumacher pointed out, I had to increase the number of PlotPoints. However, including more number of points did not necessarily change the quality a lot after a value; sort of hit a saturation point.

In case of sphere I really could not see a difference between 25 and 50 points, but probably it is too fine to notice without magnifying many times.

GraphicsGrid[
 ArrayReshape[
  {Table[
    ParametricPlot3D[{Cos[\[Phi]] Sin[\[Theta]], Sin[\[Phi]] Sin[\[Theta]], Cos[\[Theta]]}, 
     {\[Phi], 0, 2 \[Pi]}, {\[Theta], 0, \[Pi]}, RotationAction -> "Clip", 
     Mesh -> 6, BoundaryStyle -> Black, PlotRange -> ConstantArray[{-1.1, 1.1}, 3], 
     PlotStyle -> Opacity[0.2], Boxed -> False, Axes -> False, PlotPoints -> i, 
     PlotLabel -> StringJoin["PlotPoints: ", ToString[i]]], 
  {i, {Automatic, 10, 25, 50}}]},
 {2, 2}], 
ImageSize -> Full, Frame -> All]

enter image description here

After reading through Make A Smoother Or Rougher Plot: How Tos helped me realise, I could increase MaxRecursion also. But if PlotPoints is too low it does not yield any better results.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.