Plot Before You Summarise
Identical means, standard deviations and correlations can hide data of completely different shapes. One chart catches what all those numbers miss.
What you will be able to do
- Show why summary statistics are not enough
- Choose a chart from the kind of question
- Make a quick exploratory chart in matplotlib
An analyst receives four datasets. For all four, the mean of x is 9, the mean of y is about 7.5, the variances and the regression line are the same, and the correlation is 0.816. The summary reports are identical. The charts are not.
Choose the chart from the question#
| Question | Usually the right chart | Avoid |
|---|---|---|
| How does it change over time? | Line chart | Bars for dozens of time points |
| Which is bigger? | Horizontal bar chart, sorted | A pie chart with many slices |
| How are the values distributed? | Histogram, box plot | Reporting only the mean |
| Are two variables related? | Scatter plot | Two line charts on dual axes |
| What is it made of? | Stacked bar; a pie only for 2–3 parts | 3-D charts |
An exploratory chart in five lines#
import matplotlib.pyplot as plt fig, axes = plt.subplots(1, 2, figsize=(10, 4))axes[0].hist(df['delivery_hours'], bins=40)axes[0].set_title('Distribution of delivery time')axes[1].scatter(df['distance_km'], df['delivery_hours'], s=5, alpha=0.4)axes[1].set_title('Distance vs delivery time')plt.show()An exploratory chart does not need to be beautiful. It needs to be quick to make and honest: clear axis labels, enough bins to see the shape, and transparent points when the data is dense. Beauty is for the charts you present — that is the next lesson.
Two datasets have the same mean, variance and correlation. What can you conclude about their shape?
You want to show monthly revenue over the last three years. Which chart fits best?