Data Science

How to Install Matplotlib in Python?


Arpit Mehar

Content Developer Associate at almaBetter

people3 mins


Published on20 Oct, 2023

Welcome to our comprehensive guide on how to install Matplotlib in Python! If you're looking for information on "matplotlib in Python install," "command to install matplotlib in Python," "matplotlib install in Python," or "how to install Matplotlib in Python IDLE," you've come to the right place. Matplotlib is a powerful data visualization library used by data scientists, analysts, and Python enthusiasts to create stunning plots and charts. In this blog, we'll walk you through the step-by-step installation process, ensuring you can quickly and easily start leveraging Matplotlib's capabilities for your data visualization needs. Whether you're a beginner or an experienced Python user, we've covered you. Let's dive in and get Matplotlib up and running on your system!

How to Install Matplotlib in Python Using Command Prompt

To install Matplotlib in Python, you can follow these simple steps. Matplotlib is a popular data visualization library that allows you to create a wide range of plots and charts.

Step 1: Check Your Python Installation

Before installing Matplotlib, ensure you have Python installed on your system. Open your terminal or command prompt and enter the following command to check your Python version:

python --version

If Python is not installed, download and install it from the official Python website:

Step 2: Open a Terminal or Command Prompt

Open a terminal or command prompt on your computer. The exact method varies depending on your operating system.

Step 3: pip install Matplotlib in Python

To install Matplotlib, you can use Python's package manager, pip. Enter the following command:

pip install matplotlib

This command will download and install Matplotlib and its dependencies. Wait for the installation process to complete.

Step 4: Verify the Installation

After the installation, you can verify it by running a simple Python script. Create a Python script (e.g., with the following content:

import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4])
plt.ylabel('Some numbers')

Save the script and run it using the following command:


If Matplotlib is correctly installed, a window displaying a simple plot should appear.

That's it! You've successfully installed Matplotlib in Python and are now ready to create beautiful data visualizations in your Python projects.


In conclusion, we've provided you with a straightforward guide on how to install Matplotlib in Python 3.6. Following these steps, you've learned how to set up the Matplotlib library in Python, an essential skill for anyone pursuing a Python tutorial or a Data Science course.

With Matplotlib successfully installed, you are now well-equipped to harness the power of this versatile data visualization library for all your plotting needs. Whether you're a beginner taking your first steps in Python or an aspiring Data Scientist, Matplotlib is an invaluable tool to bring your data to life.

Remember that this is just the beginning of your Python journey, with endless possibilities. As you dive deeper into Data Science and programming, Matplotlib will be a valuable asset in your toolkit.

Stay curious, keep exploring, and continue learning. If you are looking for online platforms to learn more about Python or Data Science as a student, we recommend selecting institutes that offer a pay after placement model to avoid financial risks.

We wish you the best in your Python and Data Science endeavors!

Recommended Courses
Certification in Full Stack Data Science and AI
20,000 people are doing this course
Become a job-ready Data Science professional in 30 weeks. Join the largest tech community in India. Pay only after you get a job above 5 LPA.
Masters in CS: Data Science and Artificial Intelligence
20,000 people are doing this course
Join India's only Pay after placement Master's degree in Data Science. Get an assured job of 5 LPA and above. Accredited by ECTS and globally recognised in EU, US, Canada and 60+ countries.

AlmaBetter’s curriculum is the best curriculum available online. AlmaBetter’s program is engaging, comprehensive, and student-centered. If you are honestly interested in Data Science, you cannot ask for a better platform than AlmaBetter.

Kamya Malhotra
Statistical Analyst
Fast forward your career in tech with AlmaBetter

Vikash SrivastavaCo-founder & CPTO AlmaBetter

Vikas CTO
Made with heartin Bengaluru, India
  • Official Address
  • 4th floor, 133/2, Janardhan Towers, Residency Road, Bengaluru, Karnataka, 560025
  • Communication Address
  • 4th floor, 315 Work Avenue, Siddhivinayak Tower, 152, 1st Cross Rd., 1st Block, Koramangala, Bengaluru, Karnataka, 560034
  • Follow Us
  • facebookinstagramlinkedintwitteryoutubetelegram

© 2023 AlmaBetter