1

I am trying to disable the black coordinate lines that appear in plotly.

Scatter3d

I still want the stock tickers to appear as text in hover.

I have already tried turning off hovermode but then my tickers don't appear. Is there any way to specifically turn off the black gridlines that appear when I hover over a point?

Derek O
  • 16,770
  • 4
  • 24
  • 43
johnf42
  • 11
  • 1

1 Answers1

1

Plotly calls these spikes or spike lines, and they are set to appear by default for 3d scatter plots in Plotly. You can disable them with the following line:

fig.update_scenes(xaxis_showspikes=False, yaxis_showspikes=False, zaxis_showspikes=False)

For example:

import plotly.express as px
df = px.data.iris()
fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width',
              color='species')
fig.update_scenes(xaxis_showspikes=False, yaxis_showspikes=False, zaxis_showspikes=False)
fig.show()

enter image description here

Derek O
  • 16,770
  • 4
  • 24
  • 43
  • by the way if my answer helped, please consider [accepting it](https://stackoverflow.com/help/someone-answers#:~:text=To%20accept%20an%20answer%3A&text=To%20mark%20an%20answer%20as,the%20answer%2C%20at%20any%20time.) as it helps people who see this question in the future figure out which answers were the most helpful, thank you! – Derek O Jul 18 '23 at 23:07