多幅带海洋生物的boxplot,但不在同一画面内。

问题描述 投票:0回答:1

在pandas boxplot的情况下,我们可以使用。

for column in df:
    plt.figure()
    df.boxplot([column])

我们可以用 seaborn我想绘制多个boxpl图,但不是在同一个框架中,而是在循环中为每一列单独绘制。

python dataframe matplotlib seaborn boxplot
1个回答
1
投票

你可以通过一个 Axes 对象到sns.boxplot。

for column in df:
    fig, ax = plt.subplots()
    sns.boxplot(df[column], ax=ax)
© www.soinside.com 2019 - 2024. All rights reserved.