Earn 20 XP


Learning Objectives

  • Why Pyplot formatting?
  • Plotting consecutive graphs
  • Combining the 2 plots into 1

Pyplot Formatting

Tired of those plain, boring graphs? Want them to convey more information at once? This is the perfect module for you, then!

We’ll work on the same dataset, i.e., the Standard Metropolitan Data.

Plotting consecutive plots using Matplotlib

Plotting data on multiple consecutive figures can be done by calling the corresponding graphing functions and displaying each figure consecutively:

image.png

Combining the 2 plots into 1

What happens if you don't use plt.show() after the first figure? Both variables will be plotted in the same figure:

image.png