This question already has answers here:
How do I change the figure size for a seaborn plot?
                                
                                    (10个答案)
                                
                        
                                去年关闭。
            
                    
我正在尝试更改正在构建的直方图的图形大小。
我收到错误消息:

distplot() got an unexpected keyword argument 'figsize'


我试图运行的代码是这样的:

sns.distplot(MSoft['pct_change'].dropna(), bins=100, color='magenta', figsize=(20,8))

最佳答案

您需要更改绘制绘图的图形的大小-

sns.set_style('ticks')
fig, ax = plt.subplots()
fig.set_size_inches(10, 6)
sns.distplot(MSoft['pct_change'].dropna(), bins=100, color='magenta', ax=ax)

10-07 13:31