You've now been introduced to both Matplotlib and Seaborn. It's important to understand how these two libraries relate to each other because you'll often use them together.
Think of Matplotlib as the foundational engine for plotting in Python. It provides the core objects and functions necessary to create a wide variety of static, animated, and interactive visualizations. It gives you detailed control over almost every aspect of a figure, from line thickness and marker style to text placement and axis properties.
Seaborn, on the other hand, is built directly on top of Matplotlib. It aims to make creating common types of informative and attractive statistical plots much easier. Here's how it builds upon Matplotlib:
However, because Seaborn builds on Matplotlib, it doesn't replace it. Instead, they complement each other.
This diagram shows how Seaborn functions act as a convenient interface, utilizing the underlying Matplotlib engine to generate plots, often taking data directly from Pandas DataFrames. Your code can interact with both libraries.
In practice, many data scientists and engineers use Seaborn for its ease of use and attractive defaults when creating standard statistical visualizations. They then drop down to Matplotlib for fine-tuning details, adding complex annotations, or creating highly customized or non-standard plot types. As a beginner, understanding this relationship helps you appreciate why Seaborn makes certain tasks easier, while also knowing that the power of Matplotlib is always available for more detailed control. Throughout this course, you'll see examples of using both libraries, sometimes independently and sometimes together.
© 2025 ApX Machine Learning