Matplotlib expects labelsize=int in tick_params, not fontsize='large' in plt.yticks.
Step 2: Identify which line has the error
plt.yticks(fontsize='large') is invalid and will cause an error.
Final Answer:
fontsize='large' is invalid for plt.yticks -> Option B
Quick Check:
Use tick_params(labelsize=int) for ticks [OK]
Hint: Use plt.tick_params(labelsize=number) for tick font sizes [OK]
Common Mistakes:
Using string values like 'large' for tick fontsize
Thinking plt.tick_params syntax is wrong
Ignoring error messages about parameter types
5. You want to create a plot with a large title, medium axis labels, and small tick labels for clarity. Which font size settings follow good font size guidelines?
hard
A. Title fontsize=14, labels fontsize=14, ticks fontsize=14
B. Title fontsize=8, labels fontsize=20, ticks fontsize=14
C. Title fontsize=20, labels fontsize=14, ticks fontsize=8
D. Title fontsize=8, labels fontsize=8, ticks fontsize=8
Solution
Step 1: Understand font size roles for clarity
Title should be largest to stand out, axis labels medium for readability, ticks smallest to avoid clutter.
Step 2: Match options to guideline
Title fontsize=20, labels fontsize=14, ticks fontsize=8 matches this pattern: 20 (large), 14 (medium), 8 (small). Others do not follow this order.
Final Answer:
Title fontsize=20, labels fontsize=14, ticks fontsize=8 -> Option C
Quick Check:
Large title, medium labels, small ticks = A [OK]
Hint: Title > labels > ticks in font size for clarity [OK]
Common Mistakes:
Making tick labels larger than title
Using same font size for all text elements
Choosing too small font sizes causing unreadable text
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.