Thursday, 11 March 2021

Class 12 IP Practical - 02

 

1.      WAP in Python to plot frequency of marks using Line Chart

Marks=[50,40,50,65,65,75,75,80,80,90,90,90]



import matplotlib.pyplot as plt

import numpy as np

Marks=[50,40,50,65,65,75,75,80,80,90,90,90]

x,y=np.unique(Marks,return_counts = True)

plt.bar(x,y,width=3,color='r')

plt.xticks(x)

plt.xlabel("Marks")

plt.ylabel("Number of students")

plt.title("Frequency of Marks Chart")

plt.show()





 

No comments:

Post a comment