Why Visualise at All?
The human brain processes visual information roughly 60,000× faster than text. A pattern that would take minutes to spot in a table of 1,898 numbers becomes obvious in 2 seconds on a chart. But this power cuts both ways — a misleading chart can be just as convincing as an honest one.
Anscombe's Quartet is a famous demonstration: four datasets with nearly identical means, variances, and correlations — yet completely different shapes when plotted. Without visualisation, you'd treat them identically and reach completely wrong conclusions.
The Core Chart Types
Histogram
Groups values into bins (ranges) and shows how many observations fall in each bin. The shape reveals everything: Is the data symmetric? Skewed? Bimodal? Are there gaps? The x-axis is the value, the y-axis is the count. Key reading: if the right tail is long (right-skewed), the mean will be pulled above the median — most values cluster low, but a few large values drag the average up. FoodHub order cost: right-skewed, peak around $12–14, long tail toward $35.
Boxplot (Box-and-Whisker)
Shows the 5-number summary in a single shape: the box spans Q1 to Q3 (the IQR — the middle 50%). The line inside the box is the median. The whiskers extend to the fences (Q1 − 1.5×IQR and Q3 + 1.5×IQR). Any points beyond the whiskers are outliers, plotted individually as dots. Boxplots are especially powerful for comparing distributions across groups — stack them side by side and you can instantly see whether group A or group B tends higher, wider, or more skewed.
Bar Chart (Countplot)
Each bar represents a category, and its height represents a count or a value. Simple, universally understood, and highly effective for answering "which category is biggest?" questions. Use horizontal bars when category names are long (they fit without rotation). Avoid 3D bars — they distort perception. FoodHub: top restaurants by orders, cuisine types by volume.
Scatter Plot
Each dot represents one observation, placed at coordinates (x, y) for two numeric variables. Patterns become visible: upward trend = positive correlation, downward trend = negative, cloud = no relationship, curved band = non-linear relationship. Clusters suggest sub-groups. Isolated dots far from the cloud are multivariate outliers — normal on each axis individually but abnormal in combination.
Pairplot (Scatter Matrix)
A grid of scatter plots. Every row and column is a variable. Where two different variables intersect, you get a scatter plot of one against the other. Where a variable meets itself (the diagonal), you get its distribution (histogram or KDE). A pairplot on 4 variables produces a 4×4 = 16-panel grid. It's a quick overview: are there any relationships worth investigating further? FoodHub result: almost all scatter plots showed random clouds — the variables are largely independent of each other.
Heatmap (Correlation Matrix)
A colour-coded grid where each cell shows the correlation between two variables. Colour intensity = strength. The diagonal is always 1.0 (every variable perfectly correlates with itself). Symmetric about the diagonal. Good colour schemes: diverging (blue–white–red or green–white–red) so positive, zero, and negative correlations are visually distinct. The FoodHub heatmap showed that only prep_time and total_time had a meaningful correlation — which makes sense, since total_time = prep_time + delivery_time.
Chart Selection Quick Reference
What are you trying to show?
Common Mistakes to Avoid
Every chart type from this lesson appeared in the analysis. Histograms showed the right-skewed cost distribution. Boxplots revealed delivery time outliers. Bar charts ranked restaurants and cuisines. Scatter plots checked for cost–time relationships (finding none). A pairplot confirmed the independence of variables at a glance. The heatmap made the correlation structure unmistakable. See Chapter 4 — Distributions →