Computer Science, asked by chakrabortyavi2003, 6 months ago

.The score of 4 teams in 5 IPL matches is available to you. Write a program to plot these in a bar chart.(DataFrame df is already exists)​

Answers

Answered by itzbrainlyprincess16
2

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