Waffle charts can be an interesting element in a dashboard. It is especially useful to display the progress towards goals and seeing how each item contributes to the whole. But waffle charts are not very useful if you try to put too many items in it. R, Tableau, and Python each have packages or functions for waffle charts. I will show generating a waffle chart from scratch and also using Waffle function from pywaffle.

Tools to be used

For this tutorial, we will use:

  1. Numpy Library
  2. Pandas Library
  3. Matplotlib Library
  4. Jupyter Notebook environment.

Develop a Waffle Chart Without Waffle Package

  1. Import the necessary packages:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches

2. Create a DataFrame. For this tutorial, I will make a DataFrame that will fakely represent the number of immigrants from Argentina, Brazil, Cuba, and Peru to the US. The numbers are just imaginary.

#matplotlib #python

Waffle Charts Using Python’s Matplotlib
8.85 GEEK