Skip to main content
Albero Academy

Statistical Graphics

See the data before you model it — histograms, box plots and scatter plots, and choosing the right chart to reveal shape and outliers.

Chapter 7Statistics13 min readBeginner friendly
  • #Statistics
  • #Visualisation
  • #EDA

Summary numbers hide as much as they reveal. A picture of your data exposes its shape, spread, gaps and outliers instantly — which is why every analysis should start with a chart, not a formula. This chapter covers the core statistical graphics.

Why plot first?

Two datasets can share the same mean and standard deviation yet look completely different — one symmetric, one skewed, one with a wild outlier. Plotting is how you catch that before it corrupts a model.

Histograms & box plots

  • A histogram shows the distribution of one variable — is it symmetric, skewed, bimodal? Where's the peak?
  • A box plot summarises the median, quartiles (the box) and outliers (points beyond the whiskers) — great for comparing groups.
quick plots
import matplotlib.pyplot as plt
df["package"].hist(bins=20) # shape of the distribution
plt.show()
df.boxplot(column="package", by="programme") # compare groups + outliers

Scatter plots

A scatter plot shows the relationship between two numeric variables — the first thing to check before correlation or regression:

two variables
df.plot.scatter(x="experience", y="package")
# Look for: direction (up/down), strength (tight/loose), shape (linear/curved), outliers.

Why summaries aren't enough

Practice

On a dataset, plot a histogram of one numeric column and note its shape and skew. Make a box plot comparing a metric across groups and identify outliers. Then scatter two variables and describe the relationship's direction, strength and shape.

Key takeaways

  1. 01Always plot data before modelling — charts reveal shape, spread and outliers that summaries hide.
  2. 02Histograms show one variable's distribution (symmetry, skew, modes).
  3. 03Box plots summarise median/quartiles/outliers and compare groups.
  4. 04Scatter plots reveal the direction, strength and shape of a two-variable relationship.
  5. 05Identical summary stats can hide wildly different data (Anscombe's quartet).