Skip to content

Instantly share code, notes, and snippets.

@wdecoster
Last active June 8, 2023 16:51
Show Gist options
  • Save wdecoster/4365f71852520ebb9b7317ccd4ebd9a9 to your computer and use it in GitHub Desktop.
Save wdecoster/4365f71852520ebb9b7317ccd4ebd9a9 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
from pywaffle import Waffle
fig = plt.figure(
FigureClass=Waffle,
rows=5,
values={'AA': 82, 'AT': 18},
title={'label': 'Genotypes of patients', 'loc': 'center'},
legend={'loc': 'lower left', 'bbox_to_anchor': (0, -0.4), 'ncol': 2, 'framealpha': 0},
icons='male', icon_size=18,
colors=("#983D3D", "#232066"),
plot_direction='NW',
icon_legend=True
)
plt.show()
fig = plt.figure(
FigureClass=Waffle,
rows=5,
values={'AA': 96, 'AT': 4},
title={'label': 'Genotypes of healthy individuals', 'loc': 'center'},
legend={'loc': 'lower left', 'bbox_to_anchor': (0, -0.4), 'ncol': 2, 'framealpha': 0},
icons='male', icon_size=18,
colors=("#983D3D", "#232066"),
plot_direction='NW',
icon_legend=True
)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment