%config InlineBackend.figure_format = 'retina'
%matplotlib inline
from matplotlib import pyplot as plt
PIE_SLICES = [
[10, 20, 30, 40], # Pie 1 (arbitrary units, matplotlib will transform them to pct total.)
[1, 1, 2, 2], # Pie 2
[0.1, 0.8, 0.1], # Pie 3
]
plt.figure(figsize=(5,5))
ax = plt.gca()
PIE_RADIUS = 0.2
for i, slices_ in enumerate(PIE_SLICES, start=1):
pie_x = i * PIE_RADIUS * 2.5
pie_y = 1.0
ax.pie(slices_, center=(pie_x, pie_y), radius=PIE_RADIUS)
ax.text(pie_x, pie_y + PIE_RADIUS * 1.1, f"Pie {i}", ha='center', va='bottom')
pass
Created
August 28, 2019 09:50
-
-
Save lukauskas/d3ce1b29b491d78a96a3ff49cdb36410 to your computer and use it in GitHub Desktop.
Multiple Pie Charts
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment