KnowledgeBoat Logo
|

Informatics Practices

Plot a histogram of a class test of 40 students based on random sets of marks obtained by the students (MM=100).

PyPlot

2 Likes

Answer

import matplotlib.pyplot as plt
import numpy as np
marks = np.random.randint(0, 101, 40)
plt.hist(marks)
plt.title('Class Test Marks')
plt.xlabel('Marks')
plt.ylabel('Frequency')
plt.show()
Output
Plot a histogram of a class test of 40 students based on random sets of marks obtained by the students (MM=100). Data Visualization using Matplotlib, Informatics Practices Preeti Arora Solutions CBSE Class 12

Answered By

3 Likes


Related Questions