Write a Python program to plot a line chart using Matplotlib library using the following data:

ICSE Class 10 Robotics & AI PYQ · 2026 Improvement · Section B

3(iii)Written · 2026 · Section B · 2026 Improvement

Write a Python program to plot a line chart using Matplotlib library using the following data:

Show SolutionHide Solution↓
import matplotlib.pyplot as plt

date = ['1 Sep', '2 Sep', '3 Sep', '4 Sep', '5 Sep']
rainfall = [90, 92, 180, 120, 80]

plt.plot(date, rainfall)
plt.xlabel("Date")
plt.ylabel("Rainfall")
plt.title("Rainfall Data")
plt.show()

Output

Write a Python program to plot a line chart using Matplotlib library using the following data:. 2026 Board Paper, ICSE 2026 Robotics & Artificial Intelligence Solved Question Paper.
← Previous questionNext question →

Browse the free Robotics & AI sample bank