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. It was introduced by John Hunter in the year 2002.
One of the greatest benefits of visualization is that it allows us visual access to huge amounts of data in easily digestible visuals. Matplotlib consists of several plots like line, bar, scatter, histogram etc.
One of the most popular uses for Python in data analysis. Naturally, data scientists want a way to visualize their data. Either they are wanting to see it for themselves to get a better grasp of the data, or they want to display the data to convey their results to someone. With Matplotlib, arguably the most popular graphing and data visualization module for Python, this is very simplistic to do.
In order to get the Matplotlib, you should first head to Matplotlib.org and download the version that matches your version of Python.
Another library that helps in the process of plotting graphs/charts using pyplot in NumPy. NumPy stands for numerical python. NumPy is the core library for scientific computing in python. It provides a high-performance multidimensional array object and tools for working with these arrays.
Using NumPy, a developer can perform the following operations:
• Mathematical and logical operations on the array.
• Transforms and routines for shape manipulation.
• Operations related to linear algebra. NumPy has inbuilt functions for linear algebra and random number generation.
We can install NumPy using the popular python package installer pip. The command to install NumPy is as follows
pip install NumPy
NumPy will get installed onto your system and will be ready to use.
Before we start plotting graphs in matplotlib , it needs to be installed. for the installation of Matplotlib we have to follow the following steps:
open cmd (command prompt) and run command prompt as an administrator
Move to the python folder (where python has been installed)
use the following command to install Matplotlib
pip install matplotlib
the installation process of Matplotlib will start in our system.
After the successful installation of the Library package (Matplotlib), we can plot various types of graphs in the python shell using pyplot methods.