Axis caption on the Surface graph

Please tell me how to add labels to the axes on the Surface graph.
The result:

So, there isn’t any x and y axis title.

And one more question: My graph is based on numeric and text data. But on the graph, instead of text, numbers are written. Is there any way to fix this?
My data is:
Now, my code is:

fig = go.Figure(data=[go.Surface(z=data.values)])

                  xaxis_title="x Axis Title",
                  yaxis_title="y Axis Title",
                  width=500, height=500,
                  margin=dict(l=65, r=50, b=65, t=90))

In 3d, axes are instances of the classes go.layout.scene.XAxis, go.layout.scene.YAxis, respectivelygo.layout.scene.ZAxis.
Hence, instead of the two lines in your code, that set axis titles , insert:

1 Like

Yes, indeed, thank you.
And is it possible to display the text on the axis instead of the number?
(for example, i have some names of people and i would like to show them on axis (now just numbers from one to number of names) )


Yes, you can associate tickvals, and ticktext, to axes:

fig.update_scenes(xaxis= dict(tickvals=[0, 3.5, 7, 10.5, 14], #text position
                              ticktext=['John', 'Emmy', 'Liza', 'Chris', 'Pete'], #text

and similarly for yaxis.

1 Like

thank you a lot :relaxed:

1 Like