Member-only story
Hi everyone, welcome back. Matplotlib is a library for the Python programming language and is commonly used for data science and data visualization purposes. Matplotlib can be thought of a library that provides graph plotting functions that gives us visualization support. Let’s go over how you can get started with Matplotlib.
Installation
In order to work with Matplotlib, we will need to have Python and PIP installed onto our machines. Python can be downloaded and installed here and PIP can be downloaded and installed here. Once we have both Python and PIP installed, we can then install Matplotlib through the command line. Open up a command prompt or terminal and enter:
pip install matplotlib
Alternatively, Matplotlib can be downloaded and used through a Python distribution such as Anaconda or Spyder.
Importing
Now we want to import Matplotlib into our project to use. We can do this the same way we handle other imports by adding this line to our Python file:
import matplotlib
We can also import individual modules of Matplotlib into our project, for instance if we only want to import the Pyplot module, we can do so by adding this line to our file: