【发布时间】:2020-06-27 08:44:35
【问题描述】:
您好,我正在使用以下代码来绘制 3D 图表:
%matplotlib inline
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(rf_pd['max_depth'], rf_pd['n_estimators'], [1] - rf_pd['mean_train_score'], c='red', s=60)
ax.view_init(50, 320)
ax.set(xlabel='Max depth', ylabel='Nº estimators', zlabel='Error: 1 - F1 Score')
plt.title('Random Forest - F1 error al entrenar por parámetros')
fig.tight_layout()
plt.show()
fig.savefig('a.png')
问题是如何解决标签 (z) 和 X 和 Y 中的刻度被截断的事实?
谢谢
【问题讨论】:
-
也许试试: fig.tight_layout() ?有时会有所帮助。
-
不行
-
如果你添加一些填充,例如
fig.tight_layout(pad=5.0)? -
预览最差,因为刻度太近了
标签: python matplotlib jupyter-notebook