5 Data Visualization
Learn how to choose charts for comparisons, distributions, trends, and relationships, and how to design them so data is communicated clearly and accurately.
Start with the question
uses visual elements such as position, length, lines, and color to make patterns and comparisons easier to see. Begin with a clear question: what relationship should the reader notice? Choose a chart to serve that purpose rather than as decoration; simple, familiar charts are often clearest.
Match charts to their purpose
Match the chart to the kind of information or relationship you want readers to see:
Compare categories: Use a or . For example, compare the number of books borrowed at several libraries.
Show a distribution: Use a or . For example, show how exam scores are spread across students.
Show a trend over time: Use a . For example, track monthly electricity use across a year.
Show a relationship between two numerical variables: Use a . For example, compare hours studied with exam scores.
Compare categories
A compares values across categories. Give the bars a common baseline, usually zero, so their lengths represent the values honestly. Sort categories by value when ranking is the point; keep a meaningful natural order, such as age groups, when that order matters.
A is a less visually heavy alternative, especially when comparing a small set of values.
Show distributions
A groups numerical values into intervals called bins. The height of each bar shows how many observations fall in a . Histograms can reveal clusters, gaps, skew, and unusual values, but changing widths can change the apparent shape, so choose and label the widths carefully.
A summarizes a distribution using its median, quartiles, and whiskers. It is useful for comparing groups, but does not show every detail of a distribution. When sample sizes are small, consider showing individual observations as well.
Show trends
Use a when values are measured over time or another ordered, continuous scale. Put time in chronological order on the horizontal axis. Lines help readers follow change between observations, but avoid connecting points when the order has no meaningful continuity.
When comparing multiple series, label them clearly and avoid overcrowding the chart.
Show relationships
A examines how two numerical variables vary together: put one variable on each axis, and use each point to represent an observation. A general upward or downward pattern suggests an association, but does not by itself show that one variable causes the other. Look for clusters, outliers, and changes in spread as well as the overall pattern.
Build and review a clear chart
Create a chart through a sequence of checks:
State the question. For example: “Did average monthly electricity use change this year?”
Check the data. Confirm units, missing values, category labels, time intervals, and whether values are counts, rates, or percentages.
Choose the chart type. Select the chart that makes the intended comparison or pattern easiest to read. If a chart becomes crowded or tries to show several messages, split it into simpler charts.
Build the visual hierarchy. Label axes and units, use a concise title, and draw attention to the important series or comparison. Add context, such as a target line or an unusual event, when it helps interpretation.
Review the result. Check that scales, labels, colors, and annotations communicate the data accurately. Make sure the main takeaway is apparent without requiring readers to guess what the chart means.
Keep visual encodings honest
Visual encodings can make values seem different from what they are. Use scales, sizes, and colors in ways that preserve accurate interpretation.
Bar baselines: Do not truncate bar-chart baselines. When bars start above zero, small value differences can look much larger than they are. A may use a cropped axis to show modest changes, but label the scale clearly and consider whether a zero baseline would still communicate the trend well.
Comparable scales: If two charts show comparable data, different axis ranges can make similar values look very different. Avoid dual-axis charts where possible because separate scales can imply a relationship that is not present.
Visual size: For precise comparisons, position and length are generally easier to judge than area or volume. Avoid 3D effects and decorative shapes that alter perceived size or obscure values.
Color: Use one color for a single series and reserve an accent color for emphasis. Choose distinct, high-contrast colors for categories, but do not use color as the only way to distinguish groups; add labels, shapes, or patterns where appropriate. Too many colors can make a chart harder to interpret.
Context: Label units and periods, and make gaps in time or data clear. Do not suggest regular intervals if observations were irregularly spaced.