Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Matplotlib installation

Matplotlib installation

Matplotlib is a powerful Python plotting library used to create various types of static, dynamic, and interactive charts.

In this chapter, we use the pip tool to install the Matplotlib library. If the tool is not yet installed, you can refer to Python 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 via import:

import

matplotlib

In the following example, we import the matplotlib library and then check its version number:

Example

import

matplotlib

print

(

matplotlib.version

)

After executing the above code, the output is as follows:

3.4.2