Open In App

How to Install Matplotlib on python?

Last Updated : 27 Dec, 2023
Like Article

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

installing Matplotlib using conda

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

  • Use an environment for installation rather than in the base environment using the below command:
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:

installing Matplotlib using PIP

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

If successfully installed you will get the following output.

Verifying Matplotlib installation

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads