2

I have a code that makes a plot similar to this one:

import plotly.express as px
import plotly.graph_objects as go
df = px.data.tips()
fig = go.Figure(data =[go.Scatter3d(x = df['total_bill'],
                                   y = df['time'],
                                   z = df['tip'],
                                   mode ='markers')])
fig.show()

I want to add a single point with different symbol and see it among the rest of the points

I have tried this

fig.add_trace(
    go.scatter3d(x=[25],
                 y=['Dinner'],
                 z=[6],
                 mode='markers')
)

and gave me: TypeError: 'module' object is not callable

Can it be done? This is what I am looking for: enter image description here

rpanai
  • 12,515
  • 2
  • 42
  • 64

1 Answers1

0

the problem it's a typo in your code. You used go.scatter3d instead of go.Scatter3d

fig.add_trace(
    go.Scatter3d(x=[25],
                 y=['Dinner'],
                 z=[6],
                 mode='markers')
)
rpanai
  • 12,515
  • 2
  • 42
  • 64