What is Matplotlib?
Matplotlib is a Python library for 2D plotting. It is used to create static, animated, and interactive visualizations in Python. Matplotlib makes easy things easy and hard things possible. Create publication quality plots. Make interactive figures that can zoom, pan, update.
Matplotlib is a cross-platform, data visualization and graphical plotting library (histograms, scatter plots, bar charts, etc) for Python and its numerical extension NumPy. As such, it offers a viable open source alternative to MATLAB.
Matplotlib was created by John D. Hunter. Matplotlib is open source and we can use it freely. Matplotlib is mostly written in python, a few segments are written in C, Objective-C and Javascript for Platform compatibility.
Here are some of the features of Matplotlib:
- It can create a variety of plots, including histograms, scatter plots, bar charts, pie charts, and more.
- It is highly customizable, allowing you to change the appearance of your plots to suit your needs.
- It is easy to use, with a simple and intuitive syntax.
- It is well-documented, with a comprehensive user manual and many online tutorials.
If you are looking for a powerful and versatile data visualization library for Python, Matplotlib is a great option.
Installation of Matplotlib
If you have Python and PIP already installed on a system, then installation of Matplotlib is very easy.
Install it using this command:
C:UsersYour Name>pip install matplotlib
If this command fails, then use a python distribution that already has Matplotlib installed, like Anaconda, Spyder etc.
Import Matplotlib
Once Matplotlib is installed, import it in your applications by adding the import module statement:
import matplotlib
Checking Matplotlib Version
The version string is stored under __version__
attribute.
import matplotlib
print (matplotlib. __version__)