A. Using subplot number 5 in a 2x2 grid causes an error
B. plt.plot() cannot be used inside subplot
C. Missing plt.figure() before subplots
D. No error, code runs fine
Solution
Step 1: Understand subplot numbering in 2x2 grid
2 rows and 2 columns means subplot numbers 1 to 4 only.
Step 2: Check subplot number 5 usage
Using subplot(2, 2, 5) is invalid and causes an error.
Final Answer:
Using subplot number 5 in a 2x2 grid causes an error -> Option A
Quick Check:
Max subplot number = rows*columns = 4 [OK]
Hint: Subplot number must be ≤ rowsxcolumns [OK]
Common Mistakes:
Thinking plt.plot() can't be inside subplot
Believing plt.figure() is mandatory before subplots
Ignoring subplot numbering limits
5. You want to tell a story showing sales growth over 3 years with separate plots for each year. Which approach best helps your audience understand the story clearly?
hard
A. Create 3 subplots in one column using plt.subplot(3, 1, x) with clear titles and labels
B. Plot all years on one plot without labels
C. Create 1 subplot and plot only the last year's data
D. Use plt.subplot(1, 3, x) but skip titles and labels
Solution
Step 1: Choose subplot layout for storytelling
Using 3 rows and 1 column (plt.subplot(3, 1, x)) stacks plots vertically, showing each year clearly.
Step 2: Importance of titles and labels
Clear titles and labels help the audience understand each year's data easily.
Final Answer:
Create 3 subplots in one column using plt.subplot(3, 1, x) with clear titles and labels -> Option A
Quick Check:
Separate plots + clear labels = better storytelling [OK]
Hint: Stack plots vertically with titles for clear story [OK]