Practical file work_Data Visualisation
Practical file work_Data Visualisation
Source code:
import matplotlib.pyplot as plt
Games=['Pubg', 'FreeFire', 'MineCraft', 'GTA-V', 'Callofduty', 'FIFA 22']
Rating=[4.5,4.8,4.7,4.6,4.1,4.3]
plt.bar(Games,Rating,color=color=['green','orange','blue','black','red','pi
nk'])
plt.xlabel("Games")
plt.ylabel("Rating")
plt.title("Mobile app ratings")
plt.show()
Source code:
import matplotlib.pyplot as plt
Months=['March', 'April', 'May','June', 'July', 'August']
Jeans=[1500,3500,6500,6700,6000,6800]
Tshirts=[4400,4500,5500,6000,5600,6300]
Shirts=[6500,5000,5800,6300,6200,4500]
plt.plot(Months,Jeans,c='b',marker="*",markersize="20",mec="r",mfc=
"g",linestyle="dotted")
plt.plot(Months,Tshirts,c='g',marker="D",markersize="20",mec="r",mfc
="g",linestyle="dashed")
plt.plot(Months,Shirts,c='r',marker="+",markersize="20",mec="g",mfc=
"b")
plt.xlabel("Months")
plt.ylabel("Apparels price")
plt.title("Prices of Apparels")
plt.show()
Source code:
import matplotlib.pyplot as plt
Program#21 HISTOGRAM
Problem definition: Write a Python program to create a histogram with
the following dataset representing the distribution of students' scores
in a test:
Test Scores 85 78 92 88 76 95 89 72 84
● Plot a histogram to show the distribution of the test scores.
● Add appropriate labels to the x-axis and y-axis, and a title to the
chart.
● Customize the number of bins to properly visualize the data
distribution.
● Display the histogram.
Source code:
import matplotlib.pyplot as plt
# Dataset
test_scores = [85, 78, 92, 88, 76, 95, 89, 72, 84, 91]