Informatics Practices
The score of a team in 5 IPL matches is available to you. Write a program to create a pie chart from this data, showing the last match's performance as a wedge.
PyPlot
1 Like
Answer
import matplotlib.pyplot as plt
Matches = ['Match 1', 'Match 2', 'Match 3', 'Match 4', 'Match 5']
Team = [150, 160, 170, 180, 190]
expl = [0, 0, 0, 0, 0.2]
plt.pie(Team, labels = Matches, explode = expl)
plt.title('Team A Scores')
plt.show()
Output

Answered By
1 Like
Related Questions
Given a data frame df1 as shown below :
1990 2000 2010 a 52 340 890 b 64 480 560 c 78 688 1102 d 94 766 889 Write code to create a bar chart plotting the three columns of dataframe df1.
The score of four teams in 5 IPL matches is available to you. Write a program to plot these in a bar chart.
The prices of a stock for 3 months are given. Write a program to show the variations in prices for each month by 3 lines on same line chart. Make sure to add legends and labels. Show grid also.
A distribution data stores about 1000 random number. Write a program to create a scatter chart from this data with varying point sizes.