【问题标题】:how to show boxplot in jupyter?如何在jupyter中显示箱线图?
【发布时间】:2020-11-15 11:41:38
【问题描述】:

我在显示下图时遇到问题

import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd

sns.set_theme(style="whitegrid")
tips = sns.load_dataset("tips")
ax = sns.boxplot(x=tips["total_bill"])`enter code here`

错误是:模块“seaborn”没有属性“set_theme” 我该怎么办?

【问题讨论】:

    标签: python plot seaborn jupyter boxplot


    【解决方案1】:

    我遇到了同样的问题,然后我阅读了 v0.11.0 的发行说明(2020 年 9 月)https://seaborn.pydata.org/whatsnew.html

    主题

    API set() 函数已重命名为 set_theme() 以便更清楚地了解它的作用。在可预见的未来,set() 将作为别名保留,但建议更新您的代码。

    所以我卸载并重新安装了 seaborn,现在它可以工作了 :)

    pip uninstall seaborn
    pip install seaborn
    

    【讨论】:

      猜你喜欢
      • 2015-09-11
      • 2012-11-02
      • 2020-10-13
      • 2014-08-23
      • 2023-03-19
      • 2021-03-10
      • 1970-01-01
      • 2020-04-12
      • 2012-08-31
      相关资源
      最近更新 更多