如何更改 3d 绘图中的轴标签?

mat*_*ick 5 plotly

X = np.random.randn(100, 90)
import plotly.graph_objects as go

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

fig.update_layout(title='something', autosize=False,
                  width=500, height=500,
                  margin=dict(l=65, r=50, b=65, t=90))

fig.show()
Run Code Online (Sandbox Code Playgroud)

尝试了各种方法,但轴标签没有改变。他们只是说“x”和“y”。

Kri*_*aga 14

您可以更改属性内的轴标签scene

import numpy as np
import plotly.graph_objects as go

X = np.random.randn(100, 90)
import plotly.graph_objects as go

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

fig.update_layout(
    title='something', 
    autosize=False,
    width=500, 
    height=500,
    margin=dict(l=65, r=50, b=65, t=90),
    scene=dict(
        xaxis_title='X Axis Title',
        yaxis_title='Y Axis Title',
        zaxis_title='Z Axis Title',
    ),
)

fig.show()
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述