Practical_File4_Class_10_AI_Python_Matplotlib
Practical_File4_Class_10_AI_Python_Matplotlib
Instructions:
2. Add Text on the top and write your details like name, class-sec, Admn No.
3. You can modify color, style and other attributes if you want.
https://www.w3schools.com/python/matplotlib_intro.asp
Q1-Given the school result data, analyses the performance of the students on different parameters,
Q-2: Write a program to plot a bar chart in python to display the result of a school for five consecutive years.
1 import matplotlib.pyplot as pl
2
3 year=['2019','2020','2021','2022','2023'] # list of years
4 p=[98.50,70.25,55.20,90.5,61.50] #list of pass percentage
5 j=['b','g','r','m','c'] # color code of bar charts
6 pl.bar(year, p, width=0.2, color=j)
7 pl.xlabel("year") # label for x-axis
8 pl.ylabel("Pass%") # label for y-axis
9 pl.title('Result Analysis of XYZ School')
10 pl.show( ) # function to display bar chart
11
1 import numpy as np
2 import matplotlib.pyplot as plt
3
4 x = np.array([80, 85, 90, 95, 100, 105, 110, 115, 120, 125])
5 y = np.array([240, 250, 260, 270, 280, 290, 300, 310, 320, 330])
6
7 plt.plot(x, y, color='red',linestyle='dashed')
8
9 plt.title("Sports Watch Data")
10 plt.xlabel("Average Pulse")
11 plt.ylabel("Calorie Burnage")
12
13 plt.show()
14
Q4- Write a program to display a scatter chart by creating random arrays for x-points, y-points, colors and sizes
Q5- Write a program to plot a pie chart representing number of students in each house of class 10
Q6- Write a program to plot a histogram showing frequency distribution table on height of 250 people.
Q7- Write a program to plot a bar graph to compare AQI of different cities.
Q10- Write a program to display Pie chart on Favourite Activities of XYZ society residents
Q11- Write a program to display frequency distribution of marks of 2 classes using Line chart