Matplotlib Note

  1. The most basic way to use Matplotlib is through the function plot calls: plt.plot(x,y)
  2. Matplotlib is known as the “Grandfather” of plotting and visualization libraries for Python. Many other visualization libraries are built directly off of Matplotlib (e.g. seaborn and pandas built-in visualization)
  3. Matplotlib is heavily inspired by the plotting functions of the MatLab programming language
  4. This Matplotlib section seeks to clear up any confusion by clearly separating out these two approaches.
    1. Matplotlib Basics → Functional Method
    2. Matplotlib Figures and Subplots → OOP Method

Specialized plot types such as histograms won’t be covered with matplotlib, since we will later learn how to use seaborn to easily create statistical plots.

It is important to learn matplotlib first however, since seaborn builds directly off of Matplotlib

  1. Topics Covered
    1. Matplotlib Basics and Functions
    2. Matplotlib Figures
    3. Matplotlib Subplots
    4. Matplotlib Styling

Matplotlib Basic

  1. using these simple plt.plot() calls for quickly visualizing relationships and data
  2. explore the more robust OOP Matplotlib Figure API
  3. differences in displaying plots within a notebook versus running a python script
    1. .py scripts instead of .ipynb notebooks, you will need to add the plt.show() command

Matplotlib Figure Object