Skip to content
Pixel
العربية

6-3Unit 6 · Analysis and Communication

Data Visualization and Communication

11 min readStart exercises
In this lesson
  1. The Big Idea
  2. Why Turn Numbers into Charts?
  3. How Do You Choose the Right Chart?
  4. Heatmaps: Colour Tells the Value
  5. Mosaic Plots: Area Tells the Share
  6. Misleading Graphs
  7. Data Storytelling: From Chart to Message
  8. Try It Yourself
  9. Common Mistakes
  10. Key Points
  11. FAQ

The Big Idea

A table full of numbers can hide exactly the thing you are looking for. Turn it into the right picture and the pattern jumps out in a second: the busiest hours, the strongest link, the odd outlier. That is data visualization. It has two jobs: helping you understand your own data, and helping you explain it to other people. But a chart on its own is not a message. You have to pick the chart that fits the data type and the question, then tell a clear, honest story your audience can follow.

Why Turn Numbers into Charts?

Data visualization means representing data as charts or shapes so that the eye can pick up features that are hard to read from the numbers alone: the overall trend, how values are spread, and outliers.

Visualization does two jobs:

| Role | What it means | Example | |---|---|---| | Deepening the analyst's own understanding | You see the distribution, trends and outliers yourself and get new insights | You log your daily study time for a month. In a table the numbers look alike, but a line chart shows that you dip every Thursday | | Communicating data to others | You present results and conclusions, with the evidence behind them, in a way the audience understands | A bar chart of the average test score per class lets even a first-time viewer compare the classes in a second |

The first job usually happens before you know the answer: you are exploring. The second happens after: you are explaining and persuading.

How Do You Choose the Right Chart?

Before you draw, ask: what do I want the reader to see? A comparison? A change? A relationship? A pattern across a grid? Then pick the chart that answers that question:

  • Bar chart: compares categories, such as the average score of each class, or sales of each item at the canteen.
  • Line chart: shows change over time or over an order, such as temperature day by day, or your study hours week by week.
  • Scatter plot: shows the relationship between two quantitative variables, such as study time and test score; each student is one dot.
  • Heatmap: shows a numeric value for every cell of a grid, with a legend explaining the colours.
  • Mosaic plot: shows counts or shares of the combinations of two categorical variables using rectangle areas.
Which chart answers your question? A five-row guide. Compare categories: bar chart, for example average maths score per class. Show change over time or order: line chart, for example study hours week by week. Relationship of two quantitative variables: scatter plot, for example study time versus test score. A number for every cell of a grid: heatmap with a legend, for example customers by time and day. Combinations of two categorical variables: mosaic plot, for example gender by favourite subject. Footer: decide by data type, question, audience and comparison, not by the number of variables alone. Which chart answers your question? Compare categories → Bar chart e.g. average maths score for each class Show change over time or order → Line chart e.g. your study hours week by week Relationship of two quantitative variables → Scatter plot e.g. study time vs test score A number for every cell of a grid → Heatmap + legend e.g. customers by time × day Combinations of two categorical variables → Mosaic plot e.g. gender × favourite subject Decide by the data type, the question, the audience and the comparison, not by the number of variables alone.
Start from your question and your data type, then pick the chart.

There is no "number of variables" rule

You may hear that "common charts are for one or two variables, while heatmaps and mosaic plots are for three or more." The Arabic edition of the book corrects this explicitly: no rule links the chart type to the number of variables alone. A heatmap does contain three things (row, column and a value shown as colour), but you choose it because you have a value for every cell of a grid, not because you counted three variables. A mosaic plot shows only two categorical variables, yet it is not an "ordinary" chart.

Heatmaps: Colour Tells the Value

A heatmap is a grid (or matrix) of cells in which the colour of each cell represents a numeric value, together with a legend that explains each colour. The rows are one category, the columns are another, and the colour is the amount where they meet. One of the book's examples: the average temperature of each city in each month, when the goal is to compare the pattern of values across the whole grid.

Example: when is the shop busy?

The book's example: the number of customers in a shop by time of day (6 times) and day of the week (7 days), which is 42 numbers. Reading them in a table is tiring; in a heatmap the dark areas jump out at once.

Customers by time of day and day of week Heatmap grid of 6 rows (times 10:00 to 20:00) by 7 columns (Sunday to Saturday). Each cell shows the number of customers and is shaded blue, darker for more customers, according to a legend with bins 0+, 20+, 35+, 50+, 60+, 80+, 100+. The Friday and Saturday columns and the 12:00 and 18:00 rows are darkest. The busiest cell is Friday 18:00 with 110 customers; the quietest is Monday 10:00 with 10. Customers by time of day and day of week Time Sun Mon Tue Wed Thu Fri Sat 10:00 12 10 14 11 13 42 38 12:00 45 42 46 44 58 95 88 14:00 25 22 23 24 28 72 68 16:00 28 26 30 27 42 75 62 18:00 52 48 55 50 78 110 75 20:00 18 15 20 17 45 68 35 Legend: number of customers (darker = more) 0+ 20+ 35+ 50+ 60+ 80+ 100+ Darkest areas: the Fri and Sat columns and the 12:00 and 18:00 rows. Busiest cell: Fri 18:00 = 110 customers. Quietest: Mon 10:00 = 10.
The book's own values, redrawn: the darker the cell, the more customers.

What does the grid tell you? (Day names follow the Arabic edition; see the note below.)

  • Busiest days: the Friday column (total 462 customers), then Saturday (366). Sunday to Thursday range from 163 to 264.
  • Busiest times of day: 18:00 (row total 468), then 12:00 (418). The quietest time is 10:00 (140).
  • Busiest single cell: Friday at 18:00, with 110 customers.

The shop owner can act straight away: more staff on Friday and Saturday, especially at midday and in the evening.

The overplotting problem

A scatter plot is mainly for the relationship between two quantitative variables. But imagine a big school with thousands of students, and you plot study time against score for every one of them. The dots pile on top of each other into a solid blob, and you can no longer see where most students are. This is overplotting: points overlap so much that the density disappears.

The fixes the book mentions, depending on the case:

  • Transparency: make each dot partly see-through, so crowded areas look darker.
  • Binning: split the area into small squares and count the dots in each.
  • A 2-D density display: show where the dots concentrate instead of every single dot.

The Arabic edition adds that a general heatmap suits data with a value for each cell or region, and is not an automatic fix for every case of overplotting.

Mosaic Plots: Area Tells the Share

First: cross-tabulation

When you have two categorical variables, such as gender (male/female) and favourite subject (maths, science, …), you usually start with cross-tabulation: a table that counts the cases for every combination of categories, such as "how many boys prefer maths?" and "how many girls prefer science?".

Second: how a mosaic plot is built

A mosaic plot shows the counts or shares of the combinations of two categorical variables using rectangle areas. The clearest way to read it:

  1. Column width = the group's share of all students. In the book's example males are 60% and females 40%, so the male column is wider.
  2. Rectangle height inside a column = the share within that group. 35% of males prefer maths, so the maths rectangle takes 35% of the male column's height. That is why each column adds up to 100%.
  3. Rectangle area = width × height = that combination's share of all students.
Mosaic plot: favourite subject by gender Mosaic plot with two columns. The Male column is 60% of the total width and the Female column 40%. Each column is split from top to bottom into Math, Science, Arabic and English, with heights equal to the share within that gender: males 35%, 25%, 20%, 20%; females 15%, 20%, 35%, 30%. Each rectangle is labelled with its within-group share and its share of all students: male Math 21%, Science 15%, Arabic 12%, English 12%; female Math 6%, Science 8%, Arabic 14%, English 12%. Notes: width is the group's share, height is the share inside the group and each column adds to 100%, and area equals width times height, which is the share of all students, for example 0.60 × 35% = 21%. Mosaic plot: favourite subject by gender Column width = the group's share of all students Male: 60% of students Math 35% of males · 21% of all Science 25% of males · 15% of all Arabic 20% of males · 12% of all English 20% of males · 12% of all Female: 40% of students Math 15% of females · 6% of all Science 20% of females · 8% of all Arabic 35% of females · 14% of all English 30% of females · 12% of all height = share inside the group each column adds to 100% Area = width × height = share of ALL students 0.60 × 35% = 21% · 0.40 × 15% = 6% Example: male–Math is 21% of all students; female–Math is 6%
Width for the group, height within the group, area out of everyone.

Let's work out some areas:

| Combination | Width | Height | Area (share of all students) | |---|---|---|---| | Male + Maths | 60% | 35% | 0.60 × 35% = 21% | | Female + Maths | 40% | 15% | 0.40 × 15% = 6% | | Male + Arabic | 60% | 20% | 0.60 × 20% = 12% | | Female + Arabic | 40% | 35% | 0.40 × 35% = 14% | | Male + English | 60% | 20% | 0.60 × 20% = 12% | | Female + English | 40% | 30% | 0.40 × 30% = 12% |

All eight areas add up to 100%. Notice the surprise in the last row: the share within females (30%) is bigger than within males (20%), yet the number of English fans is the same on both sides, because there are more males. In a school of 200 students, that is 24 boys and 24 girls who prefer English. The area shows this; the percentages alone don't.

The book also points out two things:

  • Always state whether the chart shows counts or percentages, and how they were calculated.
  • Stacked or proportional bar charts are sometimes clearer than a mosaic plot, depending on the question and the audience.

Misleading Graphs

A misleading graph is a chart whose design distorts the real pattern, even when the data itself is correct. Common forms:

  • A truncated axis that doesn't start at zero in a bar chart, which blows up a small difference.
  • A colour scale with no legend, or a colour scale that doesn't start at zero so small differences look huge.
  • Truncated or missing categories with no note.
  • Hidden labels: a vague title, axes with no names or units, or no source.
  • A chart that doesn't fit the data, such as a line joining classes that have no natural order, suggesting a trend that isn't there.
Same data, two different pictures Two bar charts of the same data: Class A average 72 and Class B average 75. In the left, misleading chart, the vertical axis starts at 70 so B's bar looks 2.5 times taller than A's. In the right, honest chart, the axis starts at 0 and the two bars look almost equal. Note: 75 is only about 4% more than 72. Same data, two different pictures Misleading: axis starts at 70 70 72 74 76 72 Class A 75 Class B Average score out of 100 Honest: axis starts at 0 0 20 40 60 80 72 Class A 75 Class B Average score out of 100 Left: B's bar looks 2.5 times taller than A's. Truth: 75 is only about 4% more than 72.
The data is correct in both charts, but the truncated axis creates a false impression.

In the misleading chart the axis starts at 70, so Class A's bar is 72 − 70 = 2 units tall and Class B's is 75 − 70 = 5 units, making it look 2.5 times taller. In reality 75 is only about 4% more than 72. Nobody lied about a number, yet the reader got the wrong message.

Data Storytelling: From Chart to Message

Data storytelling means organising the presentation of data around a clear question or result, while keeping the context and information the reader needs to understand the data, and not hiding anything that could change the interpretation.

It has three key elements:

| Element | Meaning | Example | |---|---|---| | Clarifying the message | You can say in one sentence what the chart is meant to convey | A title like "Class 2/3 had the highest average in the maths test" instead of "Test results" | | Selecting elements | Remove what doesn't serve the message and highlight the important part | Colour the class you're talking about in a bright colour and the others in a muted colour that is still readable, without hiding context or contrary evidence | | Providing supporting information | A clear title, axis names and units, the source and period, and a scale definition or method note where needed | "Score" on the vertical axis, "Class" on the horizontal axis, "Source: first-term mark sheets" |

When the chart is done, put yourself in the audience's shoes: if a classmate saw it for the first time, could they say your message in one sentence? The same result can be understood very differently depending on how it is presented.

Try It Yourself

Try
Which chart fits?
Sort each situation into the chart that suits it best.
Items (8)
Tap an item to select it, then tap the category it belongs to.
Nothing here yet
Nothing here yet
Nothing here yet
Nothing here yet
Nothing here yet
Try
Youssef's chart for the school assembly
The situation
Youssef wants to show at the morning assembly that his class beat the class next door. His class averaged 75 and the other class 72. He drew two bars with the vertical axis starting at 70, so his bar looks much taller, and he added no axis names and no source. What do you think?
What would you do? You can try more than one choice.
Try
Key terms
Tap a card to flip it and see the other side.

Common Mistakes

"I choose the chart by the number of variables only"

The count alone isn't enough. Two variables may need a scatter plot (if both are quantitative) or a mosaic plot (if both are categorical).

Choose the chart by data type, question, audience and kind of comparison.

"The more elements in a chart, the more useful it is"

Clutter hides the pattern and distracts from the message.

Remove what doesn't serve the message and highlight what matters, while keeping context, labels and the source.

"In a mosaic plot, the number inside a rectangle is its share of all students"

In the book's example that number is the share within the group, which is the rectangle's height; that is why each column adds up to 100%.

Area = column width × height. Male–maths: 0.60 × 35% = 21% of all students.

"If the numbers are right, the chart can't mislead"

A truncated axis, a colour scale with no legend, or unlabelled axes all create a false impression from correct numbers.

An honest chart means an honest scale, labels and context, not just correct numbers.

"A heatmap automatically fixes any overplotting"

A general heatmap suits data with a value for every cell or region.

For overlapping dots, try transparency, binning or a 2-D density display, depending on the case.

Key Points

  • Data visualization turns numbers into charts that reveal trends, spread and outliers. It has two roles: deepening the analyst's understanding and communicating results to others.
  • Chart choice depends on data type, question, audience and comparison, not on the number of variables alone.
  • Bars compare categories, lines show change over time or order, and scatter plots show the relationship between two quantitative variables.
  • A heatmap is a grid where colour represents each cell's value; it is incomplete without a legend.
  • A mosaic plot shows combinations of two categorical variables by area: width is the group's share, height is the share within it, and area is the share of everyone.
  • Overplotting hides density; fixes include transparency, binning and density displays.
  • A misleading graph distorts the pattern even with correct data: a truncated axis, a scale without a legend, hidden labels.
  • Data storytelling: one-sentence message, elements that serve it, honest supporting information, then check that the audience got it.

FAQ

What is the difference between a heatmap and a mosaic plot?

A heatmap shows a numeric value for each cell of a grid using colour, such as the number of customers for each day and hour. A mosaic plot shows counts or shares of the combinations of two categorical variables using rectangle areas, such as gender and favourite subject. In the first you read colour; in the second you read area.

How do I work out the area of a rectangle in a mosaic plot?

Multiply the column width (the group's share of everyone) by the rectangle's height (the share within the group). For example, males are 60% and 35% of them prefer maths, so the area is 0.60 × 35% = 21% of all students.

Must an axis always start at zero?

For bar charts, usually yes, because a bar's length is read as an amount and a truncated axis exaggerates differences. If another chart really needs a different range, state the scale clearly so the reader doesn't get an impression the data doesn't support.

What matters most in data storytelling?

Having one clear message you can say in a sentence, choosing the elements that serve it, and adding the title, axes, units and source, without hiding anything that could change the interpretation. Finally, ask yourself whether the audience actually got the message.

Done reading? Test yourself