2
xgboost.plot_importance(model, importance_type='gain')
我无法更改此图的大小。我想将这个数字保存为适当的大小,以便我可以在pdf中使用它。我想类似像figize
如何更改xgboost.plot_importance中图的大小?
xgboost.plot_importance(model, importance_type='gain')
我无法更改此图的大小。我想将这个数字保存为适当的大小,以便我可以在pdf中使用它。我想类似像figize
如何更改xgboost.plot_importance中图的大小?
它看起来像plot_importance
return an Axes
object
ax = xgboost.plot_importance(...)
fig = ax.figure
fig.set_size_inches(h, w)
它也像您可以在
fig, ax = plt.subplots(figsize=(h, w))
xgboost.plot_importance(..., ax=ax)
传递一个轴对我来说,只有最后一个变种似乎工作。 Thx – jcuypers
^只有第二个选项适用于我。无论如何,谢谢你的答案! –