I’m trying to plot points inside a sphere (defined as a surface), but I can’t hover over the points.
I suspect this is because hoverinfo=‘skip’ (and ‘none’) only removes the info, but not the hover itself. As you can see in the GIF below, it seems that plotly is snapping to points on the sphere. Is there a way to completely remove this behavior from the sphere only?
plotly_data = []
theta = np.linspace(0,2*pi,50)
phi = np.linspace(0,pi,50)
r = 3
x = r*np.outer(np.cos(theta),np.sin(phi))
y = r*np.outer(np.sin(theta),np.sin(phi))
z = r*np.outer(np.ones(50),np.cos(phi))
sphere = go.Surface(
x=x,
y=y,
z=z,
opacity=0.2,
hoverinfo='skip', #also tried hoverinfo='none'
showscale=False,
colorscale=['blue','blue'])
plotly_data.append(sphere)
points = go.Scatter3d(
x=[0,1,2],
y=[0,1,2],
z=[0,1,2],
mode='markers',
marker={'size':5,'color':'red'},)
plotly_data.append(points)
fig = go.Figure(data=plotly_data)
fig.show()