In the previous lesson on creating line charts in Python, we explored how a visual representation of data can help us reach observations about data more quickly than a table representation of the same data. We learned how to work with the pyplot module, which provides a high-level interface to the matplotlib library, to create and customize a line chart of unemployment data. To look for potential seasonality, we started by creating a line chart of unemployment rates from 1948.

In this lesson, we'll dive a bit deeper into matplotlib and learn how to create multiple line charts to help us compare monthly unemployment trends across time. Additionally, we will learn about the important matplotlib building blocks and used them to experiment with creating multiple line charts. Similar to the last lesson, we'll analyze data from the United States Bureau of Labor Statistics to visualize unemployment data and how it changes over time.

As with every lesson at Dataquest, you'll be given an opportunity to practice each concept using our code editor with built-in answer checking to ensure that you've mastered a concept before moving on to this next.


  • Learn to work with multiple plots in your code.
  • Learn about and how to use additional matplotlib classes.
  • Learn to create a subplot in Python.

Lesson Outline

1. Recap
2. Matplotlib Classes
3. Matplotlib Classes
4. Grid Positioning
5. Adding Data
6. Formatting And Spacing
7. Comparing Across More Years
8. Overlaying Line Charts
9. Adding More Lines
10. Adding A Legend
11. Final Tweaks
12. Next Steps
13. Takeaways