3 Key Tweaks That Will Make Your Matplotlib Charts Publication Ready

Matplotlib charts are an eyesore by default — here’s what to do about it.

Article thumbnail (image by author)

Data visualization offers much deeper insights than looking at raw, numerical data.

However, creating appealing charts takes time and effort. Matplotlib is a de facto standard library for data visualization in Python. It’s simple, has been used for decades, and anything you’re looking for is one web search away.

But it’s not all sunshine and rainbows. Matplotlib visualizations look horrendous by default, and you as a data professional will have to turn many cogs to get something usable. Getting you there is the goal of today’s article.

By the end, you’ll have a code snippet you can stick to any Jupyter Notebook.

What’s Wrong with Matplotlib’s Default Styles?

You won’t need to download any dataset to follow along. You’ll create a synthetic time series dataset with increasing trend and repeatable seasonal patterns:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

# Single season multiplier factors - for seasonality effect
seasonal_multipliers = [1.1, 1.3, 1.2, 1.5, 1.9, 2.3, 2.1, 2.8, 2.0, 1.7, 1.5, 1.2]…