2
$\begingroup$

I'm trying to plot some points on the upper sheet of the hyperboloid. When I try to label them the label is partially covered by the surface. You can see this in the following code

Show[{
  ParametricPlot3D[{Sinh[x] Sin[y], Sinh[x] Cos[y], Cosh[x]}, {x, 0, 
    1}, {y, -Pi, Pi}, PlotStyle -> {Opacity[1], Yellow}, Mesh -> {5, 10}, 
   PlotPoints -> {2, 100}], 
  ListPointPlot3D[{{Sinh[0.5] Sin[Pi/2], Sinh[0.5] Cos[Pi/2], 
      Cosh[0.5]} -> Style["CS", 15]}]}]

Label is blocked by surface

How can I make the label appear in front of the surface? I have tried changing Style["CS", 15] to Text["C",{Sinh[0.5] Sin[Pi/2], Sinh[0.5] Cos[Pi/2],Cosh[0.5]}] and it doesn't help.

Thanks!

Edit: I'm using these commands inside a manipulate command (where the size of the hyperboloid changes along with other planes and curves being drawn). and I don't know the final position so moving the text or changing the point of view is not a great solution. I want to look at it from multiple points of view and always be able to see the label. Is there a way to make the labels be rendered last (i.e. on top)?

$\endgroup$

2 Answers 2

2
$\begingroup$

If you add the label using Text, you can change its position to be slightly above the surface:

Show[{
  ParametricPlot3D[{Sinh[x] Sin[y], Sinh[x] Cos[y], Cosh[x]}, {x, 0, 1}, {y, -Pi, Pi}, PlotStyle -> {Opacity[1], Yellow}, Mesh -> {5, 10}, PlotPoints -> {2, 100}], 
  ListPointPlot3D[{{Sinh[0.5] Sin[Pi/2], Sinh[0.5] Cos[Pi/2], Cosh[0.5]}}, PlotStyle -> PointSize[Large]],
  Graphics3D[Text["C", {Sinh[0.5] Sin[Pi/2], Sinh[0.5] Cos[Pi/2], Cosh[0.5] + .2}]]
  }]

enter image description here

$\endgroup$
0
$\begingroup$

You could change the ViewPoint.

Show[{ParametricPlot3D[{Sinh[x] Sin[y], Sinh[x] Cos[y], Cosh[x]}, {x, 
    0, 1}, {y, -Pi, Pi}, PlotStyle -> {Opacity[1], Yellow}, 
   Mesh -> {5, 10}, PlotPoints -> {2, 100}, 
   ViewPoint -> {Pi/3, Pi/3, Pi/3}], 
  ListPointPlot3D[{{Sinh[0.5] Sin[Pi/2], Sinh[0.5] Cos[Pi/2], 
      Cosh[0.5]} -> Style["CS", 15]}]}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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