Matplotlib
Matplotlib is the most widely used data visualization and plotting library in all of Python. In fact, as we've said before, many of the other libraries in this course utilize attributes of Matplotlib to display the plots they generate.
Much of Matplotlib's popularity comes from the fact that it is highly customizable, with users able to edit almost every aspect of a Matplotlib plot.
Matplotlib plots are comprised of a hierarchy of objects. At the top level of the plot, the Figure
is what contains the rest of the plot elements. The intermediate and lower level plot elements are objects and elements like the Axes
, Labels
, Ticks
, and Legends
. All of these elements can be tweaked by the user.
In this section, we'll cover the features of Matplotlib, and when you would want to use it. We'll then move on to covering the layout and elements that comprise a Matplotlib plot, demonstrating how to customize these elements. We'll then go over some examples of the visualizations that you can create with Matplotlib.
Finally, we'll explore the Collatz Conjecture and learn how simple number sequences can have profound visualizations.
Features of Matplotlib
One reason for Matplotlib's enduring popularity is the fact that every element of a Matplotlib plot can be customized. Plots in Matplotlib are all based on Figure
s. The Figure
is the whole window which holds a single plot or even multiple plots.