Skip to content

Instantly share code, notes, and snippets.

@srang992
Created September 24, 2022 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srang992/a3c6b5b21ed896c021cfb3d58a8698f1 to your computer and use it in GitHub Desktop.
Save srang992/a3c6b5b21ed896c021cfb3d58a8698f1 to your computer and use it in GitHub Desktop.
fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(20, 7))
df2 = pd.DataFrame(tiger_shark_case['victim_activity'].value_counts().reset_index())
df2 = df2[df2['victim_activity'] > 10]
df3 = pd.DataFrame(wobbegong_shark_case['victim_activity'].value_counts().reset_index())
df3 = df3[df3['victim_activity'] > 10]
ax1.pie(x='victim_activity', labels='index', autopct='%.1f%%', data=df2)
ax2.pie(x='victim_activity', labels='index', autopct='%.1f%%', data=df3)
ax1.set_title("Victim Activity for Tiger Shark", fontsize=18)
ax2.set_title("Victim Activity for Wobbegong Shark", fontsize=18)
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment