MATPLOTLIB
1) Write a python program to plot a line chart based on the given data to
depict the pass percentage of students in CBSE exams for the years 2019 to
2023 as shown below.
Year=[2019, 2020,2021,2022,2023]
Pass_Percentage=[85,83,90,82,92]
CODE
import [Link] as plt
Year=[2018,2019,2020,2021,2022]
Pass_Percentage=[85,83,90,82,92]
[Link](Year,Pass)
[Link]("Pass percentages in CBSE ")
[Link]([2018,2019,2020,2021,2022])
[Link]("Year")
[Link]("Percentage")
[Link]()
OUTPUT
2) Write a program in python to plot histogram. (Height of Bars are
10,1,0,33,6,8)
CODE
import numpy as np
import [Link] as plt
[Link]([0,10,20,30,40,50],bins=[0,10,20,30,40,50,60],weights=[10,1,0,3
3,6,8],edgecolor='yellow')
[Link]('Histogram of Student Data')
[Link]('value')
[Link]('Frequency')
[Link]()
OUTPUT
3) Write a python program to plot a bar chart based on the given data to
depict class wise number of students.
Classes=[IX,X,XI,XII]
Students=[30,40,20,30]
CODE
import [Link] as plt
classes=['IX','X','XI','XII']
students=[30,40,20,30]
[Link](classes,students)
[Link]('class')
[Link]('Number of students')
[Link]()
OUTPUT
4) Write a python program to plot a bar horizontal chart based on the given data
to depict number of runs per over.
overs=[1,2,3,4,5]
runs=[10,17,12,10,20]
CODE
import [Link] as plt
overs=[1,2,3,4,5]
runs=[10,17,12,10,20]
[Link](overs,runs)
[Link]('overs')
[Link]('runs')
[Link]('cricket')
[Link](True)
[Link]()
OUTPUT