Visualisation Matters
Visualisation helps convert data into insight. A spreadsheet or DataFrame may technically contain all the information required for an analysis, but it's often genuinely difficult to spot patterns from raw rows and columns alone. Charts let you see structure directly: whether sales are rising, whether values are unusually dispersed, whether a handful of sectors dominate the sample, or whether a relationship exists between two variables.
In business and management contexts, visualisation is also fundamentally a communication tool. Managers, analysts, stakeholders, and clients often need to grasp a result quickly, without wading through pages of tables. A single clear chart can communicate a pattern that would otherwise take several paragraphs of written explanation to convey with the same clarity.
That said, visualisation has to be used carefully. A poorly designed chart can mislead, exaggerate differences, hide outliers, or simply confuse its audience. Good visualisation always begins with a clear question: are we showing a trend, comparing groups, describing a distribution, or exploring a relationship? Answering that question first is what determines which chart type actually belongs here.
Choosing an Appropriate Chart
Different chart types answer fundamentally different questions, and picking the right one starts with being clear about what you're actually trying to show:
- Line charts are usually best for time-series patterns, showing how a value changes over a continuous sequence, typically time.
- Bar charts are useful for comparing discrete categories against each other, such as sectors or regions.
- Scatter plots are useful for examining the relationship between two numerical variables.
- Histograms describe the distribution of a single variable, showing how its values are spread out.
- Heatmaps can summarise many pairwise relationships at once, condensing what would otherwise be a large table into a single, quickly scannable image.
The purpose of the chart should always determine the chart type chosen, not the other way around. A common mistake, especially among newcomers to data visualisation, is picking a chart because it looks visually interesting rather than because it actually answers the analytical question at hand. A striking 3D pie chart, for instance, rarely communicates a comparison more clearly than a simple, well-labelled bar chart, it just looks more elaborate.
Python Code: First Business Trend Chart
# A first line chart: total sales across all companies over time
yearly_sales = data.groupby("year")["sales_million"].sum()
plt.figure(figsize=(9, 5))
plt.plot(yearly_sales.index, yearly_sales.values, marker="o")
plt.title("Total Sales Across All Companies")
plt.xlabel("Year")
plt.ylabel("Sales (£m)")
plt.grid(True)
plt.show()
Expected output / interpretation
The chart should show whether total sales across the 10 companies increase, decrease, or fluctuate over time.
Unpacking the code, line by line:
data.groupby("year")["sales_million"].sum()collapses the full company-year panel down into a single number per year, the total sales across every company combined. This is exactly the "split-apply-combine" pattern from earlier sessions: split by year, apply.sum(), combine into one tidy result.plt.figure(figsize=(9, 5))creates a new figure of a specified width and height (in inches), giving you control over the chart's proportions before anything is drawn onto it.plt.plot(..., marker="o")draws the line itself, with a small circular marker placed at each actual data point. Including markers like this is a small but genuinely useful habit for panel data with relatively few time points (here, just 10 years), since it makes each individual observation visually distinct, rather than implying a smooth, continuous trend where only discrete yearly figures actually exist.plt.title(),plt.xlabel(),plt.ylabel()are not optional extras, a chart without clear labels forces its reader to guess at units and context, which undermines the whole communicative purpose of visualising the data in the first place.plt.grid(True)adds light gridlines, making it easier for a reader to trace a specific point back to its approximate value on either axis.plt.show()actually renders and displays the finished figure. Without this call, matplotlib will typically build the figure internally but never actually display it.
A first interpretive habit worth building: once this chart renders, resist the urge to immediately conclude "sales are growing" or "sales are shrinking" from the shape alone. Ask instead: is the movement steady, or driven by one unusual year? Later sections in this session (particularly Section D, on trends over time, and Section E, on breakdowns by group) provide the tools to dig into exactly that kind of question properly, rather than relying on a first visual impression alone.