4(iii)
Write a Python program to plot a pie chart comparing marks of five students as given below:
stud_name = ['Jessica', 'Peter', 'Alexa', 'James', 'Ram']
marks = [48, 22, 14, 30, 49]
Import the necessary libraries.
Show SolutionHide Solution↓
import matplotlib.pyplot as plt
stud_name = ['Jessica', 'Peter', 'Alexa', 'James', 'Ram']
marks = [48, 22, 14, 30, 49]
plt.pie(marks, labels=stud_name)
plt.title("Marks of Students")
plt.show()
Output
