Arrange the query in the order of their execution.
A. Use plt.bar() with the bottom parameter for subsequent bars
B. Plot the first bar using plt.bar()
C. import matplotlib.pyplot as plt
D. Label the axes and add a title
Arrange the query in the order of their execution.
A. Use plt.bar() with the bottom parameter for subsequent bars
B. Plot the first bar using plt.bar()
C. import matplotlib.pyplot as plt
D. Label the axes and add a title
Solution
C. import matplotlib.pyplot as plt, since the library must be imported before any plt function is used.
B. Plot the first bar using plt.bar(), which forms the base of the stacked chart.
A. Use plt.bar() with the bottom parameter for subsequent bars, so each new bar starts where the previous one ends.
D. Label the axes and add a title, once all the bars are drawn.
Options 1 and 2: A comes before B, but the bottom parameter only makes sense after a first bar exists to stack on.
Option 3: D comes before A, but the labels and title are added to the finished stacked chart, after all bars are plotted.
Related questions:
2026: 23 May Shift 2
2026: 11 May Shift 2
2026: 18 May Shift 2
2026: 23 May Shift 2
2025: 22 May Shift 1