Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Scatter3d hover only working on one point

I’m trying to visualize the a variable depending on 3 more variables (test score of a ML algorithm depending on 3 hyperparameters), thus I created a 3D scatter plot. It’s working well, but hover only works on one of the 100 points and I don’t know why.

I tried setting hovermode=‘closest’ and some other stuff but nothing worked so far, I’d appreciate a lot some help

You can see my plot here:

Thanks!

I opened your plot and it’s working fine on my browser with hoverdata on all points, I don’t know why you are having a problem

Solved. (though in other browsers it wasn’t working for me either)

I was setting opacity=1 and apparently you can’t do that with 3D scatter plots when you set the line property.

trace = go.Scatter3d(
x=df4['param_max_features'],
y=df4['param_n_estimators'],
z=df4['mean_test_score'],
text=text,
mode='markers', 
marker=dict(
    size=df4.mean_fit_time * 4,
    sizemode='area',
    color=df4.mean_test_score,
    opacity=0.99,
    colorscale='Viridis',
    colorbar=dict(title = 'Test score'),
    line=dict(color='rgb(140, 140, 170)')
),

)

if you set opacity to any number lower than 1 it works.

Cheers!

Might be related to https://github.com/plotly/plotly.js/issues/3008