B. arrowprops should be a dictionary, not a string
C. Missing xytext parameter for annotation text position
D. xy parameter should be a list, not a tuple
Solution
Step 1: Check arrowprops parameter type
The arrowprops parameter must be a dictionary describing arrow style, not a string.
Step 2: Validate other parameters
The xy parameter as a tuple is correct. xytext is optional and defaults to xy. plt.plot() does not require a color argument.
Final Answer:
arrowprops should be a dictionary, not a string -> Option B
Quick Check:
arrowprops = dict, not string [OK]
Hint: arrowprops must be dict, not string [OK]
Common Mistakes:
Passing arrowprops as string
Thinking xy must be list
Assuming xytext is mandatory
Believing plt.plot needs color always
5. You want to annotate the highest point in a dataset with an arrow and label 'Max Value'. Which code correctly finds the max point and adds the annotation with an arrow pointing to it?
Using max_idx = y.index(max(y)) correctly finds the position of the highest y value in the list.
Step 2: Use plt.annotate with correct arrowprops and positions
The annotation text is placed near the max point with xytext offset, and arrowprops is a dictionary with facecolor='green'. This matches the correct syntax and logic.
Final Answer:
Uses y.index(max(y)) and arrowprops=dict(facecolor='green') -> Option A
Quick Check:
Find max index with list methods, arrowprops dict [OK]
Hint: Use y.index(max(y)) to find max point index [OK]
Common Mistakes:
Using max(x) instead of max(y) for max value
Using numpy method on list without import
Passing arrowprops as string instead of dict
Incorrect xytext offset causing overlap
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.