如何为seaborn箱线图设置y轴的范围

21 浏览
0 Comments

如何为seaborn箱线图设置y轴的范围

根据官方seaborn文档,我了解到可以创建如下的箱线图:

import seaborn as sns
sns.set_style("whitegrid")
tips = sns.load_dataset("tips")
ax = sns.boxplot(x="day", y="total_bill", data=tips)

Seaborn Boxplot Example

我的问题是:如何限制该图的y轴范围?例如,我希望y轴在[10, 40]范围内。有没有简单的方法可以实现这个要求?

0