Matplotlib is an incredible visualization library in Python. This visualization ability is incredibly useful due to its ability to show huge amounts of data in a visually appealing form. Matplotlib displays using arrays 2-D plots in the form of bar charts, pie charts, scatter plots, histograms and more.
Matplotlib is designed to work with Numpy’s 2-Dimensional arrays. Like Numpy, it is also a library used often in Scientific computing and Statistics. It would be best for you to have some basic Numpy knowledge for Matplotlib. See our Guide on Numpy here.
Installation
Make sure that you have python matplotlib and all it’s dependencies downloaded and installed before actually trying out any of the code. If you’re having problems, here’s a guide on how to how install matplotlib on a various operating systems and IDE’s.
Once you’ve installed matplotlib successfully, use the following import statement to import the pyplot module into your program.
from matplotlib import pyplotPyplot
Matplotlib is a massive library with many different uses. We could not hope to cover every aspect of it here. Hence, in this article we will just be dealing with Pyplot, a collection of functions within Matplotlib designed to make it work like MATLAB.
Pyplot is the part of Matplotlib that has most, if not all of the plotting functions. In the rest of this guide, we’ll briefly go through the various plotting functions one by one with examples. You can follow the links to access individual tutorials on each type of graph.
Line Plots
A line chart or line graph is a type of chart which displays information as a series of data points called ‘markers’ connected by straight line segments. Line graphs are most often used to find a relationship between two data sets on different axis, X and Y.
