Example of plot a pie chart in Python Matplotlib
Plot a pie chart:
plt.pie()
draws the pie plot. plt.axis(equal)
indicates that the chart should be shown in a circle.
import matplotlib.pyplot as plt labels = ['India', 'Canada', 'Japan', 'Australia', 'Russia'] sizes = [31, 19, 15, 14, 21] # Add upto 100% # Plot the pie chart plt.pie(sizes, labels=labels, autopct='%1.1f%%', startangle=90) # Equal aspect ratio ensures that pie is drawn as a circle. plt.axis('equal') # Display the graph onto the screen plt.show()
The following is the output that will be obtained:
2018-11-04T15:34:36+05:30
2018-11-04T15:34:36+05:30
Amit Arora
Amit Arora
Python Programming Tutorial
Python
Practical Solution