Standard difficulty · 20 questions · 40 marks · Time: 38 minutes
Show your working for Sections B and C. Answers are on the last page — try every question first!
Plotting Data using Matplotlib · AW-12IP-PLT-2026-V1 · For parents — fold back or tear off before handing the sheet to your child.
| Q | Answer | Working |
|---|---|---|
| 1 | (d) import matplotlib.pyplot as plt | — |
| 2 | (a) plt.bar() | — |
| 3 | (d) plt.legend() | — |
| 4 | (d) 2 | the last bin includes both 35 and 40 |
| 5 | (d) Apr | the largest y value is 76 |
| 6 | (c) 7 | 7 rows × 1 column of values |
| 7 | (a) draws a black border around each bar | — |
| 8 | (a) Red | Red has the largest height, 56 |
| 9 | To show data as a picture so that trends, comparisons, patterns and unusual values can be seen and understood quickly. | — |
| 10 | 1 | heights above 37: 49 |
| 11 | 1 | values from 10 up to but not including 20 |
| 12 | ylabel | plt.ylabel() |
| 13 | 25 | the 5th pair of the lists |
| 14 | Bottles | Bottles has the smallest height, 27 |
| 15 | 13 | every value lies between 15 and 30, so all 13 are counted |
| 16 | 4 | compare each y value with the one before it: 48, 67, 51, 25, 73, 69, 31 |
| 17 | import matplotlib.pyplot as plt sub = ['Maths', 'Science', 'English', 'Hindi', 'IP'] marks = [78, 85, 69, 74, 90] plt.bar(sub, marks, color='red') plt.title('Marks in Term 1') plt.xlabel('Subject') plt.ylabel('Marks') plt.show() | lists (1); bar with colour (1); title and labels (1); show (1) |
| 18 | import matplotlib.pyplot as plt x = ['Mon', 'Tue', 'Wed', 'Thu'] h = [32, 44, 26, 34] plt.bar(x, h, color='blue') plt.title('Students in each club') plt.xlabel('Category') plt.ylabel('Value') plt.savefig('chart.png') plt.show() | one mark each for the lists, plt.bar, the title and labels, and savefig before show |
| 19 | (a) 4; (b) 4; (c) 5 | each bin includes its left edge; the last bin includes 80 too |
| 20 | (a) Apr; (b) 4; (c) 386 | (b) the dashed line is Canteen: compare b with a month by month |