小编FAR*_*IKH的帖子

Boxplot:seaborn 中的自定义宽度

我正在尝试在seaborn中绘制箱线图,其宽度取决于x轴值的对数。我正在创建宽度列表并将其传递给 seaborn.boxplot 的 widths=widths 参数。

但是,我得到了

raise ValueError(datashape_message.format("widths"))
ValueError: List of boxplot statistics and `widths` values must have same the length
Run Code Online (Sandbox Code Playgroud)

当我调试和检查时,箱线图统计中只有一个字典,而我有 8 个箱线图。无法准确判断问题出在哪里。

这是箱线图的图像

我使用 pandas 数据框和seaborn 进行绘图。

python matplotlib boxplot seaborn

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

boxplot ×1

matplotlib ×1

python ×1

seaborn ×1