CBSE Class 12 Informatics Practices
Question 47 of 73
Data Visualization using Matplotlib — Question 12
Back to all questionsimport matplotlib.pyplot as plt
classes = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X']
strengths = [40, 43, 45, 47, 49, 38, 50, 37, 43, 39]
plt.barh(classes, strengths)
plt.title('Number of Students in Each Class')
plt.xlabel('Number of Students')
plt.ylabel('Class')
plt.show()