Matplotlib is a visualization library in Python for 2D and 3D 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 2002.
One of the greatest benefits of visualization is that it allows visual access to large amounts of data in easily digestible visuals. Matplotlib consists of several plots like line, bar, scatter, histogram etc.
Matplotlib is the most popular data visualization library in Python. It allows us to create figures and plots, and makes it very easy to produce static raster or vector files without the need for any GUIs.
Types of Plots
- Contouring and pseudocolor : The pcolormesh() function can depict a two-dimensional array in colour even if the horizontal dimensions are unevenly spaced. Contour() function is another way to depict the same data.
- Paths : Arbitrary paths can be added using the matplotlib.path module.
- Three-dimensional plotting : The mplot3d toolkit has support for simple 3d graphs such as surface, wireframe, scatter and bar chart.
- Streamplot :The streamplot() function allows mapping of colours and line widths of streamlines to a separate parameter, such as the speed.
- Ellipses :A rendering of a highly accurate 8-spline approximation to elliptical arcs that are insensitive to zoom level.
- Scatter plots :This function makes a scatter plot with optional)size and colour arguments.
- Filled curves : This allows making plot filled curves and polygons.
- Polar plots : Polar() function generates polar plots.
- Log plots : Semilogx(), semilogy() and loglog() simplify creation of logarithmic plots.
- XKCD-style sketch plots :Matplotlib also supports plotting in the xkcd style.