Skip to content

Instantly share code, notes, and snippets.

@srang992
Created September 24, 2022 13:42
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/3873cb5462ac43cb23144a24e511f052 to your computer and use it in GitHub Desktop.
Save srang992/3873cb5462ac43cb23144a24e511f052 to your computer and use it in GitHub Desktop.
fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(20, 8))
df1 = pd.DataFrame(white_shark_case["provoked/unprovoked"].value_counts().reset_index())
df2 = pd.DataFrame(tiger_shark_case["provoked/unprovoked"].value_counts().reset_index())
df3 = pd.DataFrame(wobbegong_shark_case["provoked/unprovoked"].value_counts().reset_index())
ax1.pie(data=df1, x='provoked/unprovoked', labels='index', autopct='%.1f%%', textprops={"fontsize": 14})
ax2.pie(data=df2, x='provoked/unprovoked', labels='index', autopct='%.1f%%', textprops={"fontsize": 14})
ax3.pie(data=df3, x='provoked/unprovoked', labels='index', autopct='%.1f%%', textprops={"fontsize": 14})
ax1.set_title("White Shark", fontsize=18)
ax2.set_title("Tiger Shark", fontsize=18)
ax3.set_title("Wobbegong Shark", fontsize=18)
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment