Если вы хотите сохранить ось каркаса, вы можете сделать
ax.w_xaxis.pane.fill = False
ax.w_yaxis.pane.fill = False
ax.w_zaxis.pane.fill = False
Вот полный пример:
fig = plt.figure()
ax = plt.axes(projection='3d')
x, y, z = np.random.randint(10, size=(3, 250))
ax.scatter(x, y, z, c=np.random.randn(250))
fig.set_facecolor('black')
ax.set_facecolor('black')
ax.grid(False)
ax.w_xaxis.pane.fill = False
ax.w_yaxis.pane.fill = False
ax.w_zaxis.pane.fill = False
![enter image description here](https://i.stack.imgur.com/SYaOm.png)
Или вы можете скрыть их вместе с
ax.w_xaxis.set_pane_color((0.0, 0.0, 0.0, 0.0))
ax.w_yaxis.set_pane_color((0.0, 0.0, 0.0, 0.0))
ax.w_zaxis.set_pane_color((0.0, 0.0, 0.0, 0.0))
Полный пример:
fig = plt.figure()
ax = plt.axes(projection='3d')
x, y, z = np.random.randint(10, size=(3, 250))
ax.scatter(x, y, z, c=np.random.randn(250))
fig.set_facecolor('black')
ax.set_facecolor('black')
ax.grid(False)
ax.w_xaxis.set_pane_color((0.0, 0.0, 0.0, 0.0))
ax.w_yaxis.set_pane_color((0.0, 0.0, 0.0, 0.0))
ax.w_zaxis.set_pane_color((0.0, 0.0, 0.0, 0.0))
![enter image description here](https://i.stack.imgur.com/W15iT.png)