Visualization in Python with matplotlib
Welcome to the course! In this course, we will learn the
matplotlib library, probably, one of the most popular visualization tools for Python. Within the course, we will focus on
pyplot - state-based interface to
Common practice is using the
matplotlib.pyplot. This is not compulsory, but widely used by Python community, so I recommend you to follow this rule.
The basic concept of building plots in
matplotlib is using two objects: Figure as a space for building your graph and Axes - an area where points can be specified (usually in terms of x-y coordinates, but also in a 3D plot, for example, and so on).
To create both Figure and Axes objects, you can use the
.subplots() function from
matplotlib.pyplot using multiple assignment (we need to create two variables: for
Axes objects). That's why using an alias is a good practice. Finally, after assigning
Axes objects to certain variables, we can initialize an empty plot by applying the
.plot() function to the
Axes object. Finally, we use
plt.show() to display the plot.