Arrange the given steps of drawing chart using matplotib library in correct order.
A. plt.show()
B. import matplotlib.pyplot as plt
C. pip install matplotlib
D. date=["25/12","26/12","27/12"]
temp=[8.5,10.5,6.8]
E. plt.plot(date, temp)
Arrange the given steps of drawing chart using matplotib library in correct order.
A. plt.show()
B. import matplotlib.pyplot as plt
C. pip install matplotlib
D. date=["25/12","26/12","27/12"]
temp=[8.5,10.5,6.8]
E. plt.plot(date, temp)
Solution
✅ Correct Option: 4
C: pip install matplotlib. The library must be installed before it can be imported.
B: import matplotlib.pyplot as plt. The import makes the plotting functions available.
D: date and temp lists. This is the data to be plotted.
E: plt.plot(date, temp). This draws the line chart from the data.
A: plt.show(). This displays the chart, so it comes last.
Related questions:
2026: 20 May Shift 1
2026: 18 May Shift 2
2026: 21 May Shift 1
2026: 26 May Shift 1