Matplotlib – Get Started

Matplotlib – Get Started

To get started with the matplotlib, you have to install the matplotlib in your system.

If you have pip already installed on your system, please run the following command in Terminal (Mac/Linux) or Command Prompt (Windows) to install matplotlib.

pip install matplotlib

Instead, if you pip3 installed, then run the following command.

pip install matplotlib

The following are the screenshots of installing the matplotlib in Mac.

After installing the matplotlib, to use it in your program, import the matplotlib.

In the following program, we import the matplotlib using an import statement, and then print the version of the matplotlib installed.

Python Program

import matplotlib

print(matplotlib.__version__)

Output

3.8.2
Code copied to clipboard successfully 👍