Histogram

入門

6.2.1

Histogram

Last updated 2020-01-29 Read time 1 min

Similar to a density plot, it visualizes how numerical data is distributed.

1
2
3
4
5
6
7
8
import matplotlib.pyplot as plt
import seaborn as sns

df = sns.load_dataset("iris")
sns.set(rc={"figure.figsize": (12, 8)})
sns.histplot(data=df["sepal_length"], binwidth=0.5)

plt.show()

Histogram figure

  • Density Plot — Visualize distribution with a smooth curve
  • Box Plot — Compare median, quartiles, and outliers
  • ECDF — Check the proportion below a threshold via cumulative ratio