Skip to content
Kuza Ndoto Academy

Choosing the Right Chart

Beginner → IntermediateChapter 4 · Page 14 of 204 min readUpdated 15 Nov 2026

A chart is only useful if it answers a question quickly and honestly. Choosing the right chart type, and avoiding a few classic tricks that mislead readers, matters as much as the analysis behind it.

Start with the question

Before you draw anything, say in one sentence what the chart should show. Most questions fall into a few families, and each family has a natural chart.

Your question is about…ExampleBest chartCode
Comparing categoriesRevenue by countyBar chart (sorted)ax.bar(), ax.barh(), sns.barplot()
Change over timeMonthly salesLine chartax.plot(), sns.lineplot()
Distribution of one variableSizes of customer ordersHistogram or box plotax.hist(), sns.histplot(), sns.boxplot()
Relationship between two numbersTemperature vs. soda salesScatter plotax.scatter(), sns.scatterplot()
Parts of a wholeShare of sales by payment methodStacked bar, or a pie with 2–4 slicesax.bar(..., bottom=...), ax.pie()
Many pairs of variablesCorrelations between 6 columnsHeatmapsns.heatmap()
Compare bar chart Trend over time line chart Distribution histogram / box plot Relationship scatter plot
Figure 1. The four most common questions and the chart that answers each one best (schematic shapes, not real data).

Why these choices work

Bar charts for comparisons

People judge lengths from a common baseline very accurately, so bars are the clearest way to compare amounts. Sort the bars (largest first, or largest at the top for horizontal bars) unless the categories have a natural order, such as days of the week.

Line charts for time

A line connects points in order and makes rises, falls and seasonal patterns easy to see. Use lines only when the x-axis is ordered (dates, months, years); connecting unrelated categories such as counties with a line suggests a trend that doesn't exist.

Histograms and box plots for distributions

An average hides the shape of the data. A histogram shows whether values cluster, spread out or have a long tail; a box plot compares the median and spread of several groups side by side.

Scatter plots for relationships

Each dot is one observation. An upward drift suggests a positive relationship, a downward drift a negative one, and a shapeless cloud suggests little relationship. Look out for curved patterns and outliers that a single number would hide.

A good chart, step by step

import pandas as pd
import matplotlib.pyplot as plt

revenue = pd.Series({"Kisumu": 7420, "Nairobi": 11400, "Nakuru": 3300}).sort_values()

fig, ax = plt.subplots(figsize=(6, 3))
bars = ax.barh(revenue.index, revenue.values, color="tab:blue")
ax.bar_label(bars, padding=3)                  # exact values at the end of each bar
ax.set_xlabel("Revenue (KES)")
ax.set_title("Nairobi brings in the most revenue")
ax.spines[["top", "right"]].set_visible(False)  # remove clutter
plt.show()

What the chart shows: three horizontal bars with Nairobi (11400) at the top, Kisumu (7420) in the middle and Nakuru (3300) at the bottom, each labelled with its value. Because barh() draws the first item at the bottom, sorting from smallest to largest puts the biggest bar on top. The title states the finding rather than just naming the data, so a busy reader gets the message without studying the chart.

Nairobi brings in the most revenue Nairobi Kisumu Nakuru 11400 7420 3300 0 3,000 6,000 9,000 12,000 Revenue (KES)
Figure 2. Preview of the finished chart: sorted, labelled with values, starting at zero, with a title that states the finding.

How charts mislead (and how to avoid it)

ProblemWhy it misleadsBetter
Bar chart y-axis starting above zeroA 5% difference can look like 300%Start bar axes at zero (ax.set_ylim(bottom=0))
Pie chart with many slicesPeople can't compare similar anglesA sorted bar chart
3-D effectsPerspective distorts sizesFlat 2-D charts
Two y-axes on one chartThe scales can be chosen to suggest any relationshipTwo charts side by side
Too many coloursThe reader doesn't know what mattersGrey for context, one strong colour to highlight
Missing labels or units"Sales" in KES? Units? Thousands?Label axes with units: "Revenue (KES)"
Common mistake

Truncated axes are the classic trick. If two branches earned KES 98,000 and KES 102,000 and the y-axis starts at 96,000, one bar looks three times taller than the other. Line charts may zoom in on a range, because they show change rather than size, but bars must start at zero.

Design checklist

  • Title that states the main message.
  • Axis labels with units (KES, °C, number of orders).
  • Sorted categories unless there is a natural order.
  • Direct labels on bars or lines where possible, instead of making readers match colours to a legend.
  • Colour with purpose, and colour-blind-friendly palettes (avoid relying on red versus green alone).
  • Source and date of the data in a caption when sharing outside your team.
Tip

Test your chart on a friend: show it for five seconds, then ask what it says. If they can't tell you, simplify it. The code for each chart type is on Matplotlib Basics and Seaborn.

Key points

  • Match the chart to the question: bars compare, lines show time, histograms and box plots show distributions, scatter plots show relationships.
  • Sort bars, start bar axes at zero and label everything with units.
  • Avoid 3-D, crowded pies and dual axes.
  • A title that states the finding makes a chart far more useful.
Up next · New chapter: StatisticsDescriptive StatisticsMean, median, spread and outliers.
→

Tip: use the ← and → keys to move between pages.