Track 3 · Visualising and Exploring Data · Lesson 1 of 11
Choosing the right chart
Choose a chart from the question you are asking and the types of the variables involved, and explain why other charts would mislead or hide the answer.
An HR analyst is asked three questions in one meeting: how staff are spread across departments, how salaries are distributed, and whether experience pays. Each question needs a different chart — and the wrong one can hide the answer or invent a pattern that is not there.
A chart is an answer to a question. Before drawing anything, ask two things:
- What is the question? Comparing amounts between categories, describing how values are distributed, comparing distributions between groups, looking for a relationship, or following change over time.
- What types are the variables? A categorical variable puts each case in a group (department, travel mode); an ordinal one has groups with a natural order (job level L1–L5); a numeric variable is a measured quantity (salary, minutes). Time is numeric but special: it has a direction, so we read it left to right.
The chart follows from those two answers far more often than from taste.
| Question | Variables | Default chart | Also good |
|---|---|---|---|
| How many in each group? | One categorical | Bar chart (sorted unless the categories are ordered) | Dot plot of counts; a table for a few numbers |
| How are the values spread? | One numeric | Histogram | Box plot, density curve, ECDF |
| Do groups differ? | Numeric by categorical | Box plots side by side | Violin or strip plots; small-multiple histograms |
| Are two quantities related? | Two numeric | Scatter plot | Scatter with a fitted line; hexbin when points overlap |
| How did it change? | Numeric over time | Line chart | Small multiples for many series |
| How do two categorical variables combine? | Two categorical | Grouped or 100% stacked bars | A two-way table, a heatmap of counts |
Here is the first question applied to the (synthetic) salaries dataset: 600 employees in six departments. Department is categorical, so we count each group and draw one bar per department. Bar length encodes the count, and lengths starting from a common zero baseline are what the eye compares most accurately.
Show the data as a table
| Department | Count |
|---|---|
| Operations | 183 |
| Sales | 129 |
| Technology | 125 |
| Finance | 71 |
| Human Resources | 41 |
| Legal | 51 |
The second question — how are salaries distributed? — involves one numeric variable. A bar per distinct salary would be useless (almost every salary is unique), so a histogram groups the values into intervals (bins) and shows how many fall in each.
Show the data as a table
| From | To | Count |
|---|---|---|
| 6630 | 8821.15 | 97 |
| 8821.15 | 11012.3 | 95 |
| 11012.3 | 13203.5 | 110 |
| 13203.5 | 15394.6 | 73 |
| 15394.6 | 17585.8 | 46 |
| 17585.8 | 19776.9 | 42 |
| 19776.9 | 21968.1 | 29 |
| 21968.1 | 24159.2 | 15 |
| 24159.2 | 26350.4 | 12 |
| 26350.4 | 28541.5 | 19 |
| 28541.5 | 30732.7 | 18 |
| 30732.7 | 32923.8 | 8 |
| 32923.8 | 35115 | 3 |
| 35115 | 37306.2 | 2 |
| 37306.2 | 39497.3 | 3 |
| 39497.3 | 41688.5 | 1 |
| 41688.5 | 43879.6 | 2 |
| 43879.6 | 46070.8 | 9 |
| 46070.8 | 48261.9 | 5 |
| 48261.9 | 50453.1 | 4 |
| 50453.1 | 52644.2 | 0 |
| 52644.2 | 54835.4 | 2 |
| 54835.4 | 57026.5 | 1 |
| 57026.5 | 59217.7 | 1 |
| 59217.7 | 61408.8 | 2 |
| 61408.8 | 63600 | 1 |
To compare salaries between job levels (numeric by ordinal), put one box plot per level on a shared axis. Each box spans the middle half of the salaries in that level and the line inside is the median. Keep the levels in their natural order, L1 to L5, so the staircase is visible. The median rises from 8,690 SAR at L1 to 46,020 SAR at L5.
Show the data as a table
| Group | n | Lower whisker | Q1 | Median | Q3 | Upper whisker | Outliers | Mean |
|---|---|---|---|---|---|---|---|---|
| L1 Associate | 183 | 6630 | 8060 | 8690 | 9600 | 11660 | 1 | 8859.89 |
| L2 Specialist | 195 | 9540 | 11790 | 12800 | 13725 | 16610 | 1 | 12864.6 |
| L3 Senior Specialist | 127 | 14410 | 16955 | 18820 | 20435 | 25060 | 1 | 18857.2 |
| L4 Manager | 62 | 22370 | 26970 | 28415 | 30112.5 | 34370 | 1 | 28398.4 |
| L5 Director | 33 | 37750 | 44050 | 46020 | 49110 | 55440 | 6 | 47056.7 |
The question does experience pay? links two numeric variables, so each employee becomes one point on a scatter plot: years of experience across, salary up. The cloud rises from left to right (Pearson's ), and it fans out: salaries vary more among experienced staff.
Show the data as a table
| Experience (years) | Monthly base salary (SAR) |
|---|---|
| 17.5 | 20260 |
| 2.4 | 9080 |
| 11 | 13000 |
| 12.7 | 12460 |
| 1.8 | 7740 |
| 16.8 | 16940 |
| 12.3 | 20110 |
| 5.3 | 14220 |
| 7.5 | 22110 |
| 1.5 | 8590 |
| 2 | 11560 |
| 6.3 | 9740 |
| 4.5 | 9710 |
| 7.8 | 10880 |
| 6.9 | 10980 |
| 7.9 | 12800 |
| 12.9 | 21570 |
| 7.9 | 8130 |
| 12.3 | 20690 |
| 4.6 | 24160 |
| 3.1 | 13500 |
| 10.6 | 10960 |
| 6.4 | 10180 |
| 18.4 | 38710 |
| 5.7 | 14360 |
| 13.1 | 11960 |
| 25.4 | 42390 |
| 8.9 | 12540 |
| 14.6 | 9090 |
| 11 | 17630 |
| 2.5 | 18040 |
| 2.5 | 9370 |
| 5.7 | 8560 |
| 7.2 | 13780 |
| 2.7 | 10120 |
| 14.9 | 23620 |
| 1.4 | 8890 |
| 27.7 | 30120 |
| 13.9 | 22370 |
| 5.7 | 11960 |
| 14.4 | 30090 |
| 12.9 | 27840 |
| 13.9 | 11950 |
| 2.4 | 8060 |
| 15.8 | 12120 |
| 24.9 | 63600 |
| 0.8 | 8380 |
| 6 | 27720 |
| 5.7 | 11300 |
| 12.6 | 15390 |
| 10.2 | 13960 |
| 8.8 | 11660 |
| 8.2 | 17820 |
| 19.3 | 17000 |
| 11.5 | 17170 |
| 16.9 | 19030 |
| 3.3 | 7980 |
| 9.2 | 11380 |
| 11.9 | 10140 |
| 5.7 | 12740 |
| 4.8 | 11550 |
| 15.6 | 29350 |
| 7.3 | 13140 |
| 22.2 | 44870 |
| 8.5 | 20930 |
| 6.4 | 14350 |
| 1.2 | 7270 |
| 6 | 10180 |
| 7.7 | 10620 |
| 11.5 | 16880 |
| 16.1 | 29440 |
| 18.2 | 22610 |
| 2.2 | 8360 |
| 7.9 | 12770 |
| 14 | 25820 |
| 12.6 | 30780 |
| 4.2 | 11170 |
| 13.4 | 18730 |
| 6.7 | 7090 |
| 12.3 | 18320 |
| 10.5 | 15520 |
| 8 | 11990 |
| 2.2 | 13440 |
| 1 | 9490 |
| 7.1 | 15650 |
| 8.2 | 20480 |
| 10.2 | 14820 |
| 10.3 | 19720 |
| 1.9 | 8290 |
| 6.7 | 12210 |
| 8.9 | 13010 |
| 10.6 | 13250 |
| 5.7 | 12310 |
| 5.2 | 14760 |
| 7.9 | 13660 |
| 11.2 | 21860 |
| 12.8 | 17230 |
| 11.1 | 13900 |
| 8.4 | 11450 |
| 2.6 | 9440 |
| 10.4 | 14440 |
| 5.2 | 10960 |
| 12.5 | 47310 |
| 2.7 | 10590 |
| 6.7 | 13080 |
| 8.8 | 11790 |
| 3.1 | 9220 |
| 7.4 | 10300 |
| 6.7 | 11410 |
| 9 | 16200 |
| 18.6 | 46590 |
| 31.3 | 44050 |
| 5.8 | 11230 |
| 7.2 | 8040 |
| 7.6 | 11100 |
| 5.3 | 9850 |
| 1.8 | 9240 |
| 10.8 | 15740 |
| 7.4 | 9550 |
| 4.9 | 8580 |
| 4.1 | 7780 |
| 1.4 | 7910 |
| 3.8 | 8350 |
| 9 | 15100 |
| 2.7 | 7950 |
| 5.7 | 10920 |
| 8 | 9220 |
| 14.7 | 13150 |
| 6.3 | 8570 |
| 4.6 | 9400 |
| 11 | 19100 |
| 12.3 | 22040 |
| 3.6 | 7820 |
| 17.1 | 12630 |
| 16.3 | 14790 |
| 11.5 | 20840 |
| 5.4 | 9800 |
| 6.4 | 8330 |
| 11.6 | 14520 |
| 5.3 | 10550 |
| 13.1 | 16250 |
| 11.1 | 12840 |
| 7.9 | 15260 |
| 15.2 | 18490 |
| 11.2 | 13140 |
| 3.9 | 8460 |
| 1.6 | 18680 |
| 2.3 | 9280 |
| 8.2 | 8300 |
| 5.3 | 12380 |
| 21.3 | 18980 |
| 20.6 | 32840 |
| 6.9 | 12690 |
| 4.4 | 11490 |
| 4.3 | 8090 |
| 7.3 | 14400 |
| 11.2 | 16860 |
| 13.3 | 20540 |
| 5.3 | 12120 |
| 22.5 | 28400 |
| 5.4 | 9050 |
| 3.6 | 9190 |
| 3.4 | 8740 |
| 15.3 | 13620 |
| 13.8 | 19150 |
| 11 | 12930 |
| 9.6 | 11830 |
| 8.7 | 14150 |
| 9.3 | 14310 |
| 7 | 12830 |
| 7.3 | 14240 |
| 13.4 | 13450 |
| 9.3 | 19850 |
| 12.4 | 13760 |
| 8.6 | 11170 |
| 24.9 | 22540 |
| 1.8 | 8270 |
| 6.6 | 7850 |
| 11.9 | 15500 |
| 16.5 | 22050 |
| 19.4 | 19280 |
| 25 | 44160 |
| 1 | 9630 |
| 5.7 | 10900 |
| 10.4 | 17940 |
| 17.5 | 19730 |
| 8.2 | 18820 |
| 3.6 | 7720 |
| 25.6 | 29020 |
| 10.4 | 22170 |
| 1.8 | 8900 |
| 10.8 | 20490 |
| 7.4 | 12930 |
| 5.2 | 13310 |
| 10.4 | 10120 |
| 8.1 | 7780 |
| 1.9 | 15420 |
| 8.8 | 13690 |
| 23.9 | 46870 |
| 8.9 | 8500 |
| 9.2 | 13540 |
| 4 | 9810 |
| 11.1 | 13800 |
| 25.1 | 29680 |
| 22.5 | 34370 |
| 35.5 | 61210 |
| 2.5 | 7530 |
| 4.8 | 14470 |
| 4.8 | 12300 |
| 11.6 | 11900 |
| 5.3 | 7950 |
| 4.9 | 9000 |
| 25.9 | 49110 |
| 11.5 | 26610 |
| 2.2 | 19610 |
| 2.2 | 10480 |
| 10.5 | 13240 |
| 9.6 | 8950 |
| 9.7 | 16560 |
| 2.4 | 8110 |
| 15.5 | 15790 |
| 8 | 10630 |
| 3.8 | 10860 |
| 10.1 | 11330 |
| 5.1 | 13510 |
| 13.9 | 15830 |
| 8.7 | 16850 |
| 9.6 | 12830 |
| 3 | 7640 |
| 10.2 | 20120 |
| 5.8 | 9180 |
| 16.7 | 54000 |
| 6.3 | 8210 |
| 8.5 | 13250 |
| 3 | 13420 |
| 5.7 | 14020 |
| 12.3 | 15400 |
| 8.4 | 25590 |
| 14.8 | 16790 |
| 23 | 19280 |
| 17.2 | 11830 |
| 4.1 | 7790 |
| 12.2 | 28590 |
| 13.5 | 33740 |
| 19.9 | 32390 |
| 4.8 | 10400 |
| 6.8 | 8030 |
| 4.6 | 7850 |
| 3.6 | 12800 |
| 9.6 | 12190 |
| 22.7 | 27730 |
| 9.7 | 29450 |
| 5.2 | 12450 |
| 5 | 19550 |
| 11.9 | 25440 |
| 9.3 | 11380 |
| 11.5 | 16880 |
| 11.3 | 14370 |
| 11.4 | 10340 |
| 4.5 | 12610 |
| 2.3 | 10370 |
| 4.2 | 11950 |
| 5.2 | 7380 |
| 10.7 | 10850 |
| 17 | 19470 |
| 20.3 | 17790 |
| 6.5 | 8300 |
| 9.7 | 10410 |
| 10.2 | 12680 |
| 34.4 | 55440 |
| 4.3 | 9930 |
| 4.5 | 15160 |
| 11.3 | 11980 |
| 4.8 | 8880 |
| 9.6 | 8330 |
| 26.6 | 54590 |
| 5.5 | 11910 |
| 12 | 27560 |
| 5 | 13490 |
| 15.8 | 19370 |
| 6.3 | 8430 |
| 5.6 | 7720 |
| 6.5 | 8100 |
| 9 | 15460 |
| 3.9 | 8950 |
| 13.1 | 12020 |
| 8.2 | 11860 |
| 1.6 | 13090 |
| 12.3 | 13260 |
| 14 | 8720 |
| 7.5 | 25330 |
| 1.8 | 8410 |
| 11.5 | 11610 |
| 10.2 | 12980 |
| 8.8 | 14150 |
| 12.8 | 29280 |
| 18.6 | 23800 |
| 3.2 | 8060 |
| 12 | 11350 |
| 4.5 | 8320 |
| 13.3 | 16410 |
| 17.2 | 16610 |
| 4.4 | 16900 |
| 21.3 | 12690 |
| 7.7 | 10080 |
| 6.1 | 17000 |
| 12.3 | 21610 |
| 10.9 | 17430 |
| 9.2 | 7550 |
| 10.8 | 19300 |
| 5.3 | 7110 |
| 6 | 9600 |
| 0.9 | 7980 |
| 2.8 | 8730 |
| 4.8 | 9530 |
| 15 | 27260 |
| 15.7 | 21000 |
| 5.9 | 8340 |
| 3 | 10860 |
| 3.1 | 18170 |
| 17.9 | 17260 |
| 3.4 | 13840 |
| 11.2 | 12610 |
| 10.5 | 20940 |
| 7.3 | 12610 |
| 5.9 | 12000 |
| 0.5 | 8980 |
| 9.5 | 16740 |
| 6.7 | 9010 |
| 9.5 | 25670 |
| 15.6 | 28960 |
| 8.4 | 12690 |
| 30.2 | 35240 |
| 5.3 | 9860 |
| 3.6 | 8300 |
| 3.9 | 9000 |
| 19.9 | 19590 |
| 23.9 | 19810 |
| 2.8 | 9220 |
| 17.5 | 16950 |
| 14.1 | 27720 |
| 24.5 | 15450 |
| 12.2 | 12970 |
| 33.5 | 48310 |
| 5.2 | 11290 |
| 7.1 | 7450 |
| 15.7 | 21510 |
| 19.4 | 20560 |
| 13.4 | 28290 |
| 15.7 | 28980 |
| 17.4 | 23710 |
| 19 | 19730 |
| 3.2 | 14410 |
| 14 | 21780 |
| 3.2 | 7790 |
| 10 | 28370 |
| 10.4 | 11060 |
| 7.5 | 12200 |
| 9.9 | 11080 |
| 2.6 | 11270 |
| 15.6 | 16920 |
| 5.4 | 13590 |
| 15.6 | 16540 |
| 12.9 | 11510 |
| 11 | 20160 |
| 0.8 | 11380 |
| 4.1 | 10340 |
| 16.2 | 19400 |
| 3.1 | 11720 |
| 16.3 | 28430 |
| 3.8 | 9340 |
| 7.5 | 12370 |
| 5.1 | 9570 |
| 9 | 15840 |
| 7.9 | 19930 |
| 18.1 | 31690 |
| 9 | 13250 |
| 17.3 | 30960 |
| 6.2 | 8060 |
| 7.8 | 12830 |
| 6.7 | 12070 |
| 5.4 | 8540 |
| 3.7 | 9150 |
| 6.3 | 12590 |
| 16.8 | 17140 |
| 34.2 | 48520 |
| 7.9 | 13760 |
| 9.4 | 13430 |
| 9.1 | 13540 |
| 8.5 | 10990 |
| 7.3 | 9350 |
| 19.8 | 42320 |
| 21.6 | 28460 |
| 37.7 | 47070 |
| 4.9 | 16770 |
| 7.8 | 30470 |
| 15.1 | 16960 |
| 22.1 | 18970 |
| 5.8 | 15380 |
| 10.4 | 9490 |
| 9.3 | 9270 |
| 11.5 | 8130 |
| 23.5 | 27910 |
| 38 | 44700 |
| 2.4 | 9550 |
| 13.7 | 14950 |
| 6 | 8460 |
| 20.6 | 46860 |
| 2.8 | 8690 |
| 2.7 | 10460 |
| 17.1 | 21280 |
| 26.1 | 44740 |
| 9.1 | 21120 |
| 5.3 | 17750 |
| 7.7 | 14160 |
| 10.8 | 17910 |
| 13.9 | 28030 |
| 7.2 | 9930 |
| 19.7 | 27180 |
| 18 | 19630 |
| 3.2 | 11210 |
| 13.6 | 40550 |
| 15.9 | 23530 |
| 13.2 | 17460 |
| 3.5 | 8200 |
| 14.2 | 28880 |
| 10 | 21760 |
| 11.9 | 46020 |
| 7.2 | 9780 |
| 5.9 | 12550 |
| 7.8 | 11900 |
| 3.7 | 25410 |
| 4.8 | 16930 |
| 37 | 60430 |
| 2.5 | 8720 |
| 5.2 | 13280 |
| 24.7 | 44740 |
| 16.7 | 17970 |
| 11 | 14320 |
| 5.2 | 13350 |
| 4.9 | 17360 |
| 10.7 | 27750 |
| 15.8 | 15110 |
| 18.3 | 31270 |
| 13.8 | 18930 |
| 10.2 | 8140 |
| 8 | 8550 |
| 22.9 | 18970 |
| 14.7 | 27790 |
| 7.5 | 13290 |
| 13.1 | 15130 |
| 7.8 | 8150 |
| 7 | 11630 |
| 8.2 | 7780 |
| 13.3 | 12820 |
| 12.8 | 19610 |
| 10.4 | 15370 |
| 13.6 | 30330 |
| 2.9 | 10740 |
| 2.4 | 8400 |
| 6.7 | 11390 |
| 3.8 | 8460 |
| 22 | 45820 |
| 2.8 | 10120 |
| 6.6 | 7130 |
| 1.9 | 7540 |
| 7.2 | 8260 |
| 9.7 | 11790 |
| 9.9 | 14980 |
| 2.7 | 7590 |
| 4.6 | 9460 |
| 21.1 | 39460 |
| 25 | 18810 |
| 9 | 10800 |
| 2.9 | 8740 |
| 17.3 | 12870 |
| 2.4 | 7400 |
| 6 | 11230 |
| 13.2 | 25860 |
| 6.2 | 11150 |
| 4.5 | 18180 |
| 7.8 | 15720 |
| 8.7 | 15350 |
| 7.8 | 30120 |
| 7 | 9600 |
| 4.6 | 7980 |
| 8.3 | 11700 |
| 4.3 | 9830 |
| 9.6 | 14540 |
| 2 | 11560 |
| 16.4 | 27120 |
| 17.6 | 30370 |
| 16.6 | 13340 |
| 2.6 | 11130 |
| 18.2 | 25060 |
| 16 | 10360 |
| 20.5 | 23310 |
| 19.6 | 20390 |
| 8.9 | 14040 |
| 7.7 | 7590 |
First 500 of 600 rows.
Finally, numbers recorded over time call for a line chart, because the line joining consecutive months shows direction and rhythm. Below, eight years of monthly demand for three products: each has its own seasonal peak.
- Ceiling fan
- Water heater
- School backpack
Show the data as a table
| Month index | Ceiling fan | Water heater | School backpack |
|---|---|---|---|
| 1 | 1232 | 2430 | 1080 |
| 2 | 1481 | 2264 | 429 |
| 3 | 1948 | 1483 | 453 |
| 4 | 2427 | 1304 | 539 |
| 5 | 3360 | 876 | 504 |
| 6 | 4211 | 837 | 489 |
| 7 | 4240 | 629 | 944 |
| 8 | 4524 | 726 | 3144 |
| 9 | 2822 | 937 | 1183 |
| 10 | 2242 | 1382 | 495 |
| 11 | 1584 | 2008 | 534 |
| 12 | 1224 | 2611 | 462 |
| 13 | 1440 | 2616 | 1091 |
| 14 | 1385 | 2242 | 551 |
| 15 | 1761 | 1566 | 410 |
| 16 | 2551 | 1282 | 448 |
| 17 | 3545 | 1022 | 508 |
| 18 | 4415 | 884 | 531 |
| 19 | 4039 | 747 | 1054 |
| 20 | 4351 | 792 | 3144 |
| 21 | 3335 | 1006 | 1105 |
| 22 | 2247 | 1455 | 586 |
| 23 | 1472 | 1923 | 534 |
| 24 | 1233 | 2317 | 520 |
| 25 | 1301 | 2762 | 1070 |
| 26 | 1481 | 2234 | 578 |
| 27 | 1957 | 1634 | 432 |
| 28 | 2813 | 1211 | 410 |
| 29 | 3940 | 852 | 485 |
| 30 | 4544 | 773 | 575 |
| 31 | 4511 | 674 | 988 |
| 32 | 4159 | 746 | 3616 |
| 33 | 3133 | 937 | 1371 |
| 34 | 2171 | 1476 | 529 |
| 35 | 1532 | 2119 | 527 |
| 36 | 1641 | 2863 | 470 |
| 37 | 1299 | 2635 | 1154 |
| 38 | 1412 | 2391 | 523 |
| 39 | 2004 | 1891 | 372 |
| 40 | 2991 | 1263 | 429 |
| 41 | 3951 | 1051 | 526 |
| 42 | 4086 | 762 | 514 |
| 43 | 4887 | 690 | 1030 |
| 44 | 4262 | 790 | 3049 |
| 45 | 3731 | 1103 | 1157 |
| 46 | 2230 | 1625 | 563 |
| 47 | 1735 | 2193 | 462 |
| 48 | 1514 | 3027 | 486 |
| 49 | 1362 | 2629 | 975 |
| 50 | 1891 | 2255 | 542 |
| 51 | 2167 | 2020 | 431 |
| 52 | 3136 | 1277 | 445 |
| 53 | 4405 | 959 | 605 |
| 54 | 4744 | 916 | 470 |
| 55 | 5290 | 615 | 974 |
| 56 | 4815 | 842 | 3317 |
| 57 | 3244 | 1071 | 1215 |
| 58 | 2415 | 1611 | 514 |
| 59 | 1690 | 2000 | 511 |
| 60 | 1232 | 2637 | 491 |
| 61 | 1535 | 1805 | 1167 |
| 62 | 1768 | 1898 | 553 |
| 63 | 2208 | 1326 | 432 |
| 64 | 2791 | 862 | 481 |
| 65 | 4240 | 816 | 440 |
| 66 | 5441 | 652 | 549 |
| 67 | 4976 | 532 | 1000 |
| 68 | 4866 | 644 | 3237 |
| 69 | 3403 | 873 | 1266 |
| 70 | 2631 | 1116 | 566 |
| 71 | 1961 | 1720 | 555 |
| 72 | 1310 | 2102 | 454 |
| 73 | 1627 | 1871 | 1184 |
| 74 | 1985 | 1943 | 531 |
| 75 | 2508 | 1514 | 508 |
| 76 | 3386 | 962 | 433 |
| 77 | 3874 | 834 | 511 |
| 78 | 5516 | 633 | 502 |
| 79 | 5929 | 659 | 1025 |
| 80 | 4521 | 650 | 3207 |
| 81 | 4182 | 870 | 1173 |
| 82 | 2768 | 1213 | 629 |
| 83 | 2024 | 1507 | 526 |
| 84 | 1399 | 2115 | 487 |
| 85 | 1561 | 2291 | 1061 |
| 86 | 1766 | 1721 | 473 |
| 87 | 2401 | 1296 | 501 |
| 88 | 2751 | 1052 | 547 |
| 89 | 4458 | 779 | 525 |
| 90 | 5186 | 724 | 557 |
| 91 | 5489 | 578 | 992 |
| 92 | 5730 | 702 | 2938 |
| 93 | 4069 | 872 | 1256 |
| 94 | 2937 | 1233 | 460 |
| 95 | 1881 | 1780 | 465 |
| 96 | 1731 | 2036 | 474 |
Worked example
Choosing for a manager's question
A manager asks: “Do Sales staff get bigger bonuses than Technology staff?” Which chart should you draw from the salaries data?
Question type. It compares a quantity between groups.
Variable types.
annual_bonus_saris numeric;departmentis categorical (we keep just two of its levels).Default chart. Numeric by categorical → box plots side by side on one shared axis.
Check the data. About 29% of bonuses are exactly zero. A box plot alone can hide that spike, so add the share with no bonus in the caption, or show strip plots of the individual values.
Side-by-side box (or strip) plots of bonus for Sales and Technology on a common axis, with the percentage receiving no bonus reported for each.
Quick check
You want to show what share of 600 employees work in each of six departments. Which chart is the safest default?
Exercises
The lesson is complete when every exercise is answered correctly. Hints are free; viewing a worked solution before solving means the exercise won't count towards mastery.
0 of 9 exercises correct (not saved — sign in to keep your progress)
Exercise 1 · Guided, difficulty 1 of 3
From question to chart
Sort each question into the chart that answers it best by default.
Exercise 2 · Practice, difficulty 1 of 3
Match the variables to a chart
Each item names variables from the library datasets. Match each to the most suitable default chart.
Exercise 3 · Application, difficulty 1 of 3
Read the department bar chart
The bar chart in the lesson shows how many of the 600 employees work in each department. What percentage of employees work in Operations? Use the salaries dataset (or the chart's data table) and give the answer to 1 decimal place.
Data: salaries · Open in the lab to explore and calculate.
Exercise 4 · Application, difficulty 2 of 3
Read a median off the box plots
In the box plots of base salary by job level, read the median monthly base salary of L4 Manager employees. Then check it from the data (the dataset here is filtered to the L4 rows). Enter the median in SAR; a reading within 2% is accepted.
Data: salaries (job_level = L4 Manager) · Open in the lab to explore and calculate.
Exercise 5 · Interpretation, difficulty 2 of 3
A pie of averages
A colleague draws a pie chart with one slice per department, where each slice's size is the department's average base salary. What is wrong with this chart?
Exercise 6 · Practice, difficulty 2 of 3
Charts that can compare distributions
You want to compare the distribution of base salary across the five job levels (not just one average per level). Select all charts that can do this well.
Exercise 7 · Practice, difficulty 1 of 3
Steps in choosing a chart
Put these steps for choosing and checking a chart in a sensible order.
Exercise 8 · Practice, difficulty 1 of 3
How many employees in the biggest group?
A bar chart shows the number of employees in six departments of another (fictional) company:
| Department | Operations | Sales | Technology | Finance | Human Resources | Legal |
|---|---|---|---|---|---|---|
| Employees | 103 | 77 | 120 | 22 | 21 | 92 |
What percentage of all employees are in the department with the tallest bar? Give your answer to 1 decimal place.
Exercise 9 · Interpretation, difficulty 2 of 3
Justify your chart
A director asks: “Do employees with more experience earn more — and is that pattern the same in every department?” In two or three sentences, say which chart you would draw from the salaries data and justify it (what goes on each axis, and how you would show department).
What you can now do
- Start from the question and the variable types, not from a favourite chart
- Use bars for categories, histograms for one numeric variable, box plots for groups, scatter plots for two numeric variables and lines for time
- Read counts, shares and medians accurately from bar charts and box plots
- Explain why pies of averages and lines through categories mislead