The Most Underrated and Underutilized Features of Matplotlib

Matplotlib is far more capable than most users think.

I have been using matplotlib for many years now.

Based on that, I believe that one of the best yet underrated and underutilized potentials of matplotlib is the amount of customizability it can offer.

But being unaware of that, most matplotlib users use it as a naive plotting utility with almost zero customization.

And as the default plots never appear “appealing”, they resort to other libraries, Plotly, for instance, to create elegant plots.

Yet, I firmly believe that in 90-95% of cases, you would NEVER need to look beyond matplotlib.

It can do much more than what most users think.

For instance, consider the two plots below:

Yes! Both plots were created using matplotlib.

But some custom formatting makes the second plot much more elegant, informative, appealing, and easy to follow.

  • The title and subtitle significantly aid the story.

  • Also, the footnote offers extra important information, which is nowhere to be seen in the basic plot.

  • Lastly, the bold bar immediately draws the viewer’s attention and conveys the purchase category’s importance.

Thus, in my opinion, the overwhelming potential for customization makes matplotlib far more capable than what most users think.

A departing lesson

One of the things I always ensure towards being a good storyteller in my data science projects is that my plot must demand minimal effort from the viewer.

Thus, I never shy away from putting in that extra effort.

This has been especially true for professional environments.

At times, it is also good to ensure that our visualizations convey the right story, even if they are viewed in our absence.

The below plot is a classic example of that.

In this entire post, I never discussed what that plot is about — somewhat indicating my absence.

Yet, by staring at this plot for a few seconds, you can quickly figure out what I intended to highlight here, can’t you?

You can download the code notebook for this post here: Matplotlib Notebook.

👉 Over to you: What are some other underrated gems of matplotlib that most users aren’t aware of?

👉 If you liked this post, don’t forget to leave a like ❤️. It helps more people discover this newsletter on Substack and tells me that you appreciate reading these daily insights.

The button is located towards the bottom of this email.

Thanks for reading!

Latest full articles

If you’re not a full subscriber, here’s what you missed last month:

To receive all full articles and support the Daily Dose of Data Science, consider subscribing:

👉 Tell the world what makes this newsletter special for you by leaving a review here :)

👉 If you love reading this newsletter, feel free to share it with friends!

Reply

or to participate.