这是我的代码:
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(10,8))
ax = fig.gca(projection='3d') # get current axis
surf = ax.plot_surface(X, Y, Z)
ax.set_xlabel('Intercept')
ax.set_ylabel('Slope')
ax.set_zlabel('Error')
最佳答案
您可以使用labelpad参数:
plt.zlabel(*, labelpad=20)
或者您可以稍后更改它:
ax.zaxis.labelpad = 20
不断尝试直到它满足您的需求。
关于python - matplotlib 中轴的标签被刻度覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36448733/