Skip to content

Write a Python program to display the given Result using a BAR CHART

Write a Python program to display the given Result using a BAR CHART

SOLUTION

Bar chart program

import matplotlib.pyplot as plt

# Line Plot
RESULT[['Maths', 'Science', 'SST']].plot(kind='line', marker='o')

plt.title("Result Analysis")
plt.xlabel("Name")
plt.ylabel("Score")
plt.grid(True)
plt.show()

(i) Title set as “Result Analysis”
✔ (ii) Labels “Name” (x-axis) and “Score” (y-axis)
✔ (iii) Legend displayed automatically (Maths, Science, SST)