How to install matplotlib in Python?

A matplotlib is an open-source Python library which used to plot the graphs. It is originally conceived by the John D. Hunter in 2002 . The version was released in 2003, and the latest version is released 3.1.1 on 1 July 2019.

It represents the data through the graphical form. The graphical form can be a Scatter Plot, Bar Graph, Histogram, Area Plot, Pie Plot, etc. The matplotlib library is generally used to data visualization. Data visualization allows us to make a effective decision for organization.

Let’s see the installation of the matplotlib.

Installing the matplotlib

Before working with the matplotlib library, we need to install it in out Python environment. Let’s see the following method of installing matplotlib library.

Using Anaconda distribution of Python

The Anaconda distribution is an easiest way to install matplotlib library because matplotlib is pre-installed in it. So we don’t need to further installation.

  • Go to its official site and click the download button.

  • Select the download the version according to your Python interpreter configuration.

Installing Matplotlib using the Matplotlib

We can also install the matplotlib using the conda prompt. Open the conda prompt and type the following command.

conda install matplotlib

Using pip command

The pip can also use to install the matplotlib library. Open the command prompt, type the following command.

pip install matplotlib

Confirm the Installation

To verify that matplotlib is installed properly or not, type the following command includes calling .__version __ in the terminal

import matplotlib
matplotlib.version
‘3.1.1’

Now, we are ready to work with the matplotlib.