Should you use Matplotlib for plotting or a newer library?

Matplotlib is an amazing piece of software, it is super customizable and able to create the greatest variety of plots in the Python ecosystem and is the most frequently used Python plotting library. However it comes at a cost, its API is not the most user friendly, it could take you some time to come up with a pretty looking plot with the information that you want. So should you use it, or opt for one of the tens of newer plotting libraries?

While Matplotlib is awesome if you want to create a super customized plot, most commonly you want something that is pretty standard and looks nice. There are some higher-level libraries built on top of matplotlib that provide additional functionality with a more user-friendly interface and since they are built on top of matplotlib, you do have the option to do lower-level customizations where needed.

Working with pandas dataframes? Use pandas visualization API. If you are doing general statistical plots, then seaborn is the way to go. If you are working with machine learning, yellowbrick provides visualizers that can make you more productive. Working on creating animations celluloid provides a better API. Perhaps you are working with geospatial data, try out geoplot. All these utilize matplotlib under the hood but provide a higher level API so you can create prettier graphs with fewer lines of code.

There are some cases where you might want to not use a matplotlib based library. Want to use a more declarative language for generating plots? Use Altair. Want something that is web-friendly? Use bokeh and holoviews.

In the end, directly using matplotlib for common plots is probably not worth it for most cases but when you do need a highly customized plot, matplotlib is a great choice.