Back to Seaborn

Distributions

doc/_tutorial/distributions.ipynb

0.13.23.9 KB
Original Source
python
%matplotlib inline
import seaborn as sns; sns.set_theme()
python
penguins = sns.load_dataset("penguins")
sns.displot(penguins, x="flipper_length_mm")
python
sns.displot(penguins, x="flipper_length_mm", binwidth=3)
python
sns.displot(penguins, x="flipper_length_mm", bins=20)
python
tips = sns.load_dataset("tips")
sns.displot(tips, x="size")
python
sns.displot(tips, x="size", bins=[1, 2, 3, 4, 5, 6, 7])
python
sns.displot(tips, x="size", discrete=True)
python
sns.displot(tips, x="day", shrink=.8)
python
sns.displot(penguins, x="flipper_length_mm", hue="species")
python
sns.displot(penguins, x="flipper_length_mm", hue="species", element="step")
python
sns.displot(penguins, x="flipper_length_mm", hue="species", multiple="stack")
python
sns.displot(penguins, x="flipper_length_mm", hue="sex", multiple="dodge")
python
sns.displot(penguins, x="flipper_length_mm", col="sex")
python
sns.displot(penguins, x="flipper_length_mm", hue="species", stat="density")
python
sns.displot(penguins, x="flipper_length_mm", hue="species", stat="density", common_norm=False)
python
sns.displot(penguins, x="flipper_length_mm", hue="species", stat="probability")
python
sns.displot(penguins, x="flipper_length_mm", kind="kde")
python
sns.displot(penguins, x="flipper_length_mm", kind="kde", bw_adjust=.25)
python
sns.displot(penguins, x="flipper_length_mm", kind="kde", bw_adjust=2)
python
sns.displot(penguins, x="flipper_length_mm", hue="species", kind="kde")
python
sns.displot(penguins, x="flipper_length_mm", hue="species", kind="kde", multiple="stack")
python
sns.displot(penguins, x="flipper_length_mm", hue="species", kind="kde", fill=True)
python
sns.displot(tips, x="total_bill", kind="kde")
python
sns.displot(tips, x="total_bill", kind="kde", cut=0)
python
diamonds = sns.load_dataset("diamonds")
sns.displot(diamonds, x="carat", kind="kde")
python
sns.displot(diamonds, x="carat")
python
sns.displot(diamonds, x="carat", kde=True)
python
sns.displot(penguins, x="flipper_length_mm", kind="ecdf")
python
sns.displot(penguins, x="flipper_length_mm", hue="species", kind="ecdf")
python
sns.displot(penguins, x="bill_length_mm", y="bill_depth_mm")
python
sns.displot(penguins, x="bill_length_mm", y="bill_depth_mm", kind="kde")
python
sns.displot(penguins, x="bill_length_mm", y="bill_depth_mm", hue="species")
python
sns.displot(penguins, x="bill_length_mm", y="bill_depth_mm", hue="species", kind="kde")
python
sns.displot(penguins, x="bill_length_mm", y="bill_depth_mm", binwidth=(2, .5))
python
sns.displot(penguins, x="bill_length_mm", y="bill_depth_mm", binwidth=(2, .5), cbar=True)
python
sns.displot(penguins, x="bill_length_mm", y="bill_depth_mm", kind="kde", thresh=.2, levels=4)
python
sns.displot(penguins, x="bill_length_mm", y="bill_depth_mm", kind="kde", levels=[.01, .05, .1, .8])
python
sns.displot(diamonds, x="price", y="clarity", log_scale=(True, False))
python
sns.displot(diamonds, x="color", y="clarity")
python
sns.jointplot(data=penguins, x="bill_length_mm", y="bill_depth_mm")
python
sns.jointplot(
    data=penguins,
    x="bill_length_mm", y="bill_depth_mm", hue="species",
    kind="kde"
)
python
g = sns.JointGrid(data=penguins, x="bill_length_mm", y="bill_depth_mm")
g.plot_joint(sns.histplot)
g.plot_marginals(sns.boxplot)
python
sns.displot(
    penguins, x="bill_length_mm", y="bill_depth_mm",
    kind="kde", rug=True
)
python
sns.relplot(data=penguins, x="bill_length_mm", y="bill_depth_mm")
sns.rugplot(data=penguins, x="bill_length_mm", y="bill_depth_mm")
python
sns.pairplot(penguins)
python
g = sns.PairGrid(penguins)
g.map_upper(sns.histplot)
g.map_lower(sns.kdeplot, fill=True)
g.map_diag(sns.histplot, kde=True)