Skip to content

Instantly share code, notes, and snippets.

@Zmey56
Created May 11, 2022 21:06
Show Gist options
  • Save Zmey56/2fd4e130efae57621f8b579d878f7a6b to your computer and use it in GitHub Desktop.
Save Zmey56/2fd4e130efae57621f8b579d878f7a6b to your computer and use it in GitHub Desktop.
color_pie = ['Grey', 'Purple', 'Blue', 'Green', 'Orange', 'Red', 'Yellow', 'magenta', 'cyan']
color_pie_dict = dict(zip(df_weights_circle.columns, color_pie))
fig, axes = plt.subplots(2, 2, figsize=(15, 10))
for i, (idx, row) in enumerate(df_weights_circle.iterrows()):
ax = axes[i//2, i%2]
row = row[row.gt(row.sum() * .01)]
ax.pie(row, labels=row.index, colors=[color_pie_dict.get(i) for i in row.index], startangle=30)
ax.set_title(idx)
fig.subplots_adjust(wspace=.2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment