Matplotlib Object-Oriented Approach
Explore the Matplotlib object-oriented API to build flexible and customizable data visualizations. Understand how to create figure objects, add multiple axes, and manage complex plots with control over layout and labels. Gain skills to produce detailed plots suitable for advanced data analysis and storytelling.
We'll cover the following...
We’ve already seen how to do basic plotting. However, it’s generally recommended to use an object-oriented approach because it allows us much more control over our plots, as well as more customization options.
Let’s break down and learn the formal introduction of Matplotlib’s object-oriented API for plotting data.
The idea behind the object-oriented approach is that we create figure objects and then call methods or attributes from that object. This elegant approach is helpful when we are dealing with a canvas that has multiple plots on it.
To start, let’s create a figure instance ...