Trace projections appearing on hover


#1

I asked this question here but the problem might be python specific.

How do I remove the coordinate projections on hover for a surface in python plotly? According to the reference, I thought the following would do it, but they still appear.

import plotly
import plotly.graph_objs as go
import numpy as np

theta = np.linspace(0,2*np.pi,50) 
x = np.linspace(0,10,50) 

tg,xg = np.meshgrid(theta,x) 

y = np.cos(tg)
z = np.sin(tg)

contours = dict(
x=dict(
        project=dict(
                x=False,
                y=False,
                z=False)),
y=dict(
        project=dict(
                x=False,
                y=False,
                z=False)),
    z=dict(
            project=dict(
                    x=False,
                    y=False,
                    z=False)),
    )

surf = go.Surface(x=xg,y=y,z=z,contours=contours,opacity=0.7)
fig = go.Figure(data=[surf])
plotly.offline.plot(fig)

Thanks for any help you can provide.


#2

@bob It seems that you want to remove the coordinates displayed on hover.
If this is the case, insert hoverinfo='none'in the surf definition:
surf = go.Surface(x=xg, y=y, z=z, hoverinfo='none', opacity=0.7)


#3

@empet Thank you for your reply. However, that is not what I’m interested in. I’m interested in the black lines present in the surface and their projections into the ambient coordinate system, as pictured here:

A different, but related question maybe you can help answer: in your understanding, what does/should the False values in the following do?

x=dict(
        project=dict(
                x=False,
                y=False,
                z=False)),

I thought it would give the desired effect, but it actually seems to do nothing.


#4

@bob What you call projections are in fact the intersections of the x, y, respectively z - planes through a point of the surface with that surface.

Projections onto the z-plane, for example, are the level-lines (contour lines) on the surface projected orthogonally onto the z-plane.
Here is the Plotly reference: https://plot.ly/python/reference/#surface-contours and here an example:
https://plot.ly/~empet/14521 .

Analogously you can project the contour lines onto the x or y-plane.


#5

@empet Thank you for your informative reply. I totally get the meaning behind the projections. Is there any way to get rid of the lines I described?


#6

@bob No, you cannot remove the lines of intersection :frowning:


#7

@empet Apparently the lines I was referring to are called ‘spikes’. They can be turned off in

layout -> scene -> zaxis -> showspikes=False.