【问题标题】:How to plot a single column using Seaborn?如何使用 Seaborn 绘制单列?
【发布时间】:2020-12-03 10:57:39
【问题描述】:

假设我有这样的数据集

a=np.array([1,2,3,4,5,6,7,8,9])
b=np.array([1,2,3,4,4,4,4,4,4])

我想比较两个数据集,看看它们之间的区别,像这样

我在 seaborn 中找不到任何可以实现这一点的方法,像线图或散点图这样的方法需要 x 和 y 轴,任何人都可以帮助解决这个问题

【问题讨论】:

    标签: seaborn data-visualization data-analysis


    【解决方案1】:

    我刚刚找到答案

    将 seaborn 导入为 sns 将 numpy 导入为 np

    sns.lineplot(data=_a)
    

    以前,我是这样使用的,导致错误

    sns.lineplot(x=_a)
    sns.lineplot(_a)
    

    【讨论】:

      猜你喜欢
      • 2018-03-29
      • 1970-01-01
      • 2020-06-23
      • 2022-01-06
      • 2017-12-09
      • 2021-04-26
      • 2019-07-29
      • 2018-07-05
      • 2019-10-23
      相关资源
      最近更新 更多