Matplotlib logo

Matplotlib

Matplotlib is the go-to library for plotting within python, with numerous packages and libraries using Matplotlib as a base to build off of. If you were to learn a single plotting tool to keep in your toolbox, this is the package.

Why Matplotlib?

Matplotlib is a plotting library for Python and is often the first plotting package Python-learners encounter. You may be wondering, “Why learn Matplotlib? Why not Seaborn or another plotting library first?”

The simple answer is because of Matplotlib’s popularity. Matplotlib is one of the most popular Python packages. Because of its history as Python’s “go-to” plotting package, most other open source plotting libraries (including Seaborn) are built on top of Matplotlib and thus these more specialized plotting packages still inherit some of Matplotlib’s capabilities, syntax, and limitations. You will find it useful to be familiar with Matplotlib when learning other plotting libraries.

Matplotlib supports a variety of output formats, chart types, and interactive options, and runs well on most operating systems and graphic backends. The key feature to Matplotlib is its extensibility and the extensive documentation available to the community. These reasons are part of “Why Matplotlib” is so popular, and the first plotting language we will introduce you to in this book.

In this section

This section contains tutorials on basic plotting with Matplotlib.

From the Matplotlib documentation “Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.”

Currently, we provide a basic introduction to Matplotlib, as well as:

  • Histograms

  • Piecharts

  • Animations

  • Annotations

  • Colorbars

  • Contour plots

  • Customizing layouts