November 2018
Beginner to intermediate
214 pages
5h 2m
English
Let's take a look at the fractions of gases that exist in our atmosphere. The following content shows the code and output for Nitrogen, which is 78 percent of our atmosphere, Oxygen, which is 21 percent, and Argon, which is 1 percent. Now, naturally, Nitrogen, Oxygen, and Argon are not exactly numerical values. Hence, we cannot really plot these things against each other in the standard way. This is where we can use a pie chart as a best practice to display these differences:
# Basic Pie Chartfracs = (78, 21, 1)labels = ('Nitrogen', 'Oxygen', 'Argon')plt.pie(fracs, labels=labels);plt.gca().set_aspect('equal')
We will get the following ...
Read now
Unlock full access