April 2018
Beginner to intermediate
300 pages
7h 34m
English
Pie chart is a circular representation of component ratios. The angle, and hence the arc length of each sector ratio (also called wedges), presents the proportion that each component accounts for, relative to the whole.
Matplotlib provides the plt.pie() function to draw pie charts. We can label each sector with labels as well as the percentage with autopct automatically. For different ways to customize the string format of the percentages, you may refer to: https://pyformat.info/. To maintain the circular shape of our pie chart, we specify the same width and length for a square figure with plt.figure(figsize=(n,n)). Here, we have an example of web server usage in the first week of January 2017:
# Data obtained from https://trends.builtwith.com/web-server ...
Read now
Unlock full access