Back to Seaborn

Boxenplot

doc/_docstrings/boxenplot.ipynb

0.13.2965 B
Original Source
python
import seaborn as sns
sns.set_theme(style="whitegrid")
diamonds = sns.load_dataset("diamonds")
python
sns.boxenplot(x=diamonds["price"])
python
sns.boxenplot(data=diamonds, x="price", y="clarity")
python
large_diamond = diamonds["carat"].gt(1).rename("large_diamond")
sns.boxenplot(data=diamonds, x="price", y="clarity", hue=large_diamond, gap=.2)
python
sns.boxenplot(data=diamonds, x="price", y="clarity", width_method="linear")
python
sns.boxenplot(data=diamonds, x="price", y="clarity", width=.5)
python
sns.boxenplot(data=diamonds, x="price", y="clarity", k_depth="trustworthy", trust_alpha=0.01)
python
sns.boxenplot(
    data=diamonds, x="price", y="clarity",
    linewidth=.5, linecolor=".7",
    line_kws=dict(linewidth=1.5, color="#cde"),
    flier_kws=dict(facecolor=".7", linewidth=.5),
)
python
sns.boxenplot(data=diamonds, x="price", y="clarity", hue="clarity", fill=False)