Open In App

How to Install Matplotlib on python?

Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. In this article, we will look into the various process of installing Matplotlib on Windows.

Install Matplotlib on Windows

For Conda Users

If you want the installation to be done through conda, you can use the below command:



conda install matplotlib

Type y for yes when prompted.

You will get a similar message once the installation is complete



Make sure you follow the best practices for installation using conda as:

conda create -n my-env
conda activate my-env

Note: If your preferred method of installation is conda-forge, use the below command:

conda config --env --add channels conda-forge

For PIP Users using pip install matplotlib

pip install matplotlib command can be used to install it. Users who prefer to use pip can use the below command to install Matplotlib:

pip install matplotlib

You will get a similar message once the installation is complete:

Verifying Matplotlib Installation

To verify if Matplotlib has been successfully installed in your system using pip install matplotlib run the below code in a Python IDE of your choice:




import matplotlib
matplotlib.__version__

If successfully installed you will get the following output.

Article Tags :