I'd like to create a waffle chart in grey shapes for the following dataFrame
data = pd.DataFrame({'Category': ['a', 'b', 'c', 'd'], 'no_occurrence' : [594, 5, 10, 9]})
Here is what I've done so far based on this post
import matplotlib.pyplot as plt
from pywaffle import Waffle
fig = plt.figure(
FigureClass=Waffle,
rows=5,
colors = ('lightgrey', 'black', 'darkgrey', 'lightgrey'),
values=list(data['no_occurrence']/4),
labels=list(data['Category']),
icons = 'sticky-note',
icon_size = 11,
figsize=(12, 8),
icon_legend = True,
legend={'loc': 'lower left','bbox_to_anchor': (0, -0.4), 'ncol': len(data), 'fontsize': 8}
)
As the grey shapes are quite difficult to distinguish, I'd like to hatch the last category (in the figure and the legend) but I can't figure out how to add the hatches in the colors. I have a bar chart with the same categories, where I added hatches, so I'd like to stay consistent.