How to change size of plot in xgboost.plot_importance?

前端 未结 1 1301
天涯浪人
天涯浪人 2021-02-06 00:24
xgboost.plot_importance(model, importance_type=\'gain\')

I am not able to change size of this plot. I want to save this figure with proper size so that

相关标签:
1条回答
  • 2021-02-06 01:01

    It looks like plot_importance return an Axes object

    ax = xgboost.plot_importance(...)
    fig = ax.figure
    fig.set_size_inches(h, w)
    

    It also looks like you can pass an axes in

    fig, ax = plt.subplots(figsize=(h, w))
    xgboost.plot_importance(..., ax=ax)
    
    0 讨论(0)
提交回复
热议问题