Tooltips hidden/inactivated by SphericalPlot3D

2

1

Any way to get points obscured by SphericalPlot3D to show their Tooltip?

In the below example, Tooltips will appear when cursor moves over little spheres that are not obscured by the plot, but will not appear for spheres behind or within the SphericalPlot3D surface.

ttPoints = RandomReal[{-1, 1}, {15, 3}];
Show[
 Graphics3D[Tooltip[Sphere[2 #, .1], #] & /@ ttPoints]

, SphericalPlot3D[
  1.5 + .1 Sin[5 ϕ], {θ, 0, Pi}, {ϕ, 0, 2 Pi}
  , Mesh -> None
  , PlotStyle -> Opacity[.25]
  , BoxRatios -> {1, 1, 1}
  ]
]

Plotted Surface and small spheres

Brian Swift

Posted 2019-05-23T00:24:00.527

Reputation: 195

I'm using Version 12.0.0. on MacOS 10.13.6 – Brian Swift – 2019-05-23T00:27:35.350

you need to provide an Epilog to override the 3D graphic, I believe. There is a post about geoplot and some city markings on a globe. I think that is what you want to do to overcome this! – CA Trevillian – 2019-05-23T02:13:15.563

1does Show[SphericalPlot3D[ 1.5 + .1 Sin[5 \[Phi]], {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi}, Mesh -> None, PlotStyle -> Opacity[.25], BoxRatios -> {1, 1, 1}], Graphics3D[{Sphere[ #, .1] & /@ ttPoints, Tooltip[Text["", #], #] & /@ ttPoints}], ImageSize -> 400] work in your version/os? – kglr – 2019-05-23T04:09:51.747

Answers

3

  1. Remove Tooltip from Spheres and
  2. Add Tooltipped Text objects with the same coordinates using Tooltip[Text["", #], #] & /@ ttPoints

SeedRandom[1]
ttPoints = RandomReal[{-1, 1}, {15, 3}]; 
Show[ SphericalPlot3D[1.5 + .1 Sin[5 ϕ], {θ, 0, Pi}, {ϕ, 0, 2 Pi}, 
  Mesh -> None, PlotStyle -> Opacity[.25], BoxRatios -> {1, 1, 1}], 
 Graphics3D[{Sphere[#, .1] & /@ ttPoints, 
   Tooltip[Text["", #], #] & /@ ttPoints}]]

enter image description here

Note: This approach works in version 9 (Windows 64 bit). Cannot check if it works in later versions.

Note: Modified OP's example so that all spheres fall inside the spherical plot surface.

kglr

Posted 2019-05-23T00:24:00.527

Reputation: 302 076

Thanks. Works fine on Version 12.0.0. on MacOS 10.13.6. – Brian Swift – 2019-05-23T23:18:26.157

1

An alternative approach:

$Version

(* "12.0.0 for Mac OS X x86 (64-bit) (April 7, 2019)" *)

SeedRandom[1234];
ttPoints = RandomReal[{-1, 1}, {15, 3}] // Sort;

Manipulate[
 Column[{Show[
    Graphics3D[
     Transpose[
      {ReplacePart[
        ConstantArray[LightBlue, Length[ttPoints]],
        pt -> Red],
       Tooltip[Sphere[2 #, .1], #] & /@ ttPoints}]],
    SphericalPlot3D[1.5 + .1 Sin[5 ϕ],
     {θ, 0, Pi}, {ϕ, 0, 2 Pi},
     Mesh -> None,
     PlotStyle -> Opacity[.25],
     BoxRatios -> {1, 1, 1}],
    ImageSize -> Medium],
   ttPoints[[pt]]}],
 {{pt, 1, Point},
  Thread[Range[Length[ttPoints]] ->
    (NumberForm[#, {4, 1}] & /@ ttPoints)],
  ControlType -> RadioButtonBar}]

enter image description here

Bob Hanlon

Posted 2019-05-23T00:24:00.527

Reputation: 95 281

We could also do the same sort-of work around with an application of Epilog, no? It should, then, be possible to roll over the smaller spheres, and have the Tooltips appear in a single designated space! – CA Trevillian – 2019-05-23T03:06:06.627