Matplotlib Installation
Matplotlib is a powerful Python plotting library used to create various types of static, animated, and interactive charts.
In this chapter, we use the pip tool to install the Matplotlib library. If you have not installed this tool yet, you can refer toPython pip Installation and Usage。
Upgrade pip:
python3 -m pip install -U pip
Install the matplotlib library:
python3 -m pip install -U matplotlib
After installation, we can import the matplotlib library using import:
import matplotlib
In the following example, we import the matplotlib library and then view the version number of it:
Examples
import matplotlib
print(matplotlib.__version__)
print(matplotlib.__version__)
Running the above code produces the following output:
3.4.2Other Extensions