The score of four teams in 5 IPL matches is available to you. Write a program to plot these in a bar chart.
Answers
Answered by
7
Answer:
import numpy as np
import matplotlib.pyplot as plt
# data to plot
n_groups = 5
men_means = (22, 30, 33, 30, 26)
women_means = (25, 32, 30, 35, 29)
# create plot
fig, ax = plt.subplots()
index = np.arange(n_groups)
bar_width = 0.35
opacity = 0.8
rects1 = plt.bar(index, men_means, bar_width,
alpha=opacity,
color='g',
label='Men')
rects2 = plt.bar(index + bar_width, women_means, bar_width,
alpha=opacity,
color='r',
label='Women')
plt.xlabel('Person')
plt.ylabel('Scores')
plt.title('Scores by person')
plt.xticks(index + bar_width, ('G1', 'G2', 'G3', 'G4', 'G5'))
plt.legend()
plt.tight_layout()
plt.show()
Explanation:
Hope it helps ☺️☺️
Plz mark me as brainliest ✌️✌️ and follow me
Similar questions
Math,
3 months ago
Accountancy,
3 months ago
English,
7 months ago
Chemistry,
7 months ago
Chemistry,
11 months ago
Social Sciences,
11 months ago
Hindi,
11 months ago