Basic Plotting

Let’s learn about plotting some basic plots using matplotlib.

Introduction

Matplotlib is the most popular plotting library for Python. Its creator, John HunterJohn D. Hunter (August 1, 1968 – August 28, 2012) was an American neurobiologist and the original author of Matplotlib. originally wrote it to visualize the electrocorticography (ECoG) data of epilepsy patients during his post-doctoral research in neurobiology. He created this library to replicate MATLAB’s plotting capabilities in Python. (If you’ve ever worked with MATLAB, you’ll find it natural to work with matplotlib will feel natural to you). This open-source library ultimately emerged as the most widely used plotting library for Python and a core component of the scientific Python stack, along with NumPy, SciPy, and IPython.

Along with providing great control on every element in a figure, Matplotlib makes it very easye to work with simple plots. Matplotlib is very customizable in general and, with just a few lines of code, it generates high-quality plots, histograms, power spectra, bar charts, error charts, scatter-plots, and so on.

(Click here to see the Matplotlib source code on github)

Get hands-on with 1200+ tech skills courses.