dsl*_*990 7 python machine-learning matplotlib python-3.x xgboost
xgboost.plot_importance(model, importance_type='gain')
Run Code Online (Sandbox Code Playgroud)
我无法改变这个情节的大小.我想以适当的大小保存这个数字,以便我可以在pdf中使用它.我想要类似的figize
tac*_*ell 25
看起来像是plot_importance 返回一个Axes对象
ax = xgboost.plot_importance(...)
fig = ax.figure
fig.set_size_inches(h, w)
Run Code Online (Sandbox Code Playgroud)
看起来你也可以通过轴
fig, ax = plt.subplots(figsize=(h, w))
xgboost.plot_importance(..., ax=ax)
Run Code Online (Sandbox Code Playgroud)