Introduction to Matplotlib
Hey there! In this article, we are going to see how to set up Matplotlib.
Before that, let’s see what Matplotlib actually is
Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy.
Installation of Matplotlib
If you have Python and PIP already installed on a system, then installation of Matplotlib is very easy.
Install it using this command:
C:\Users\Your Name>pip install matplotlib
If this command fails, then use a python distribution that already has Matplotlib installed, like Anaconda, Spyder etc.
Import Matplotlib
Once Matplotlib is installed, import it into your applications by adding the import module
statement:
import matplotlib
Now Matplotlib is imported and ready to use:
Checking Matplotlib Version
The version string is stored under __version__
attribute.
Example
import matplotlibprint(matplotlib.__version__)