Dont show ticks on 3D Scatter

Hi,

Is there a direct way with plotly express to hide the ticks of all the three axis on a 3D scatterplot.

fig = px.scatter_3d(d, x='d1', y='d2', z='d3', color='cluster')
fig.update_traces(marker=dict(size=3))
fig.update_layout(title_text='Document embeddings', title_x=0.5, showlegend=False)
fig.update_xaxes(showticklabels=False)
fig.update_yaxes(showticklabels=False)

This is what I can get from the docs so far but it is not hidding any axis
Thanks!

Hi @PabloRR10. Thanks for your interest in Plotly Express! The axes on 3D charts have a bit of a different syntax for interacting with them. Rather than using update_xaxes and update_yaxes, you should use update_layout in order to target the axes in the 3d scene.

fig.update_layout(
    scene=dict(
        xaxis=dict(showticklabels=False),
        yaxis=dict(showticklabels=False),
        zaxis=dict(showticklabels=False),
    )
)
1 Like