【问题标题】:distplot() got an unexpected keyword argument 'figsize' [duplicate]distplot()得到了一个意外的关键字参数'figsize' [重复]
【发布时间】:2018-09-09 09:16:16
【问题描述】:

我正在尝试更改我正在构建的直方图的图形大小。 我收到了错误:

distplot() got an unexpected keyword argument 'figsize'

我要运行的代码是这样的:

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

【问题讨论】:

    标签: python pandas matplotlib seaborn


    【解决方案1】:

    你需要改变图形的大小,在其上绘制 -

    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)
    

    【讨论】:

    • 效果很好,谢谢!
    猜你喜欢
    • 2016-06-27
    • 1970-01-01
    • 1970-01-01
    • 2016-09-17
    • 2015-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多