Skip to content

Instantly share code, notes, and snippets.

@manuelinfosec
Created March 14, 2022 22:13
Show Gist options
  • Save manuelinfosec/42c8f26aea2c6780be26c7fc1a9eb122 to your computer and use it in GitHub Desktop.
Save manuelinfosec/42c8f26aea2c6780be26c7fc1a9eb122 to your computer and use it in GitHub Desktop.
# import the essential libraries
from matplotlib import pyplot as plt
# create the data
subjects = ["Mathematics", "Integrated Science", "Business Studies", "Computer Application"]
scores = [85, 62, 57, 92]
# Plot the pie plot
plt.pie(scores,
labels=subjects,
colors=['r','g','b','y'],
startangle=90,
shadow=True,
explode=(0,0.1,0,0),
autopct='%1.11f%%')
# Add title to plot
plt.title("Student Performance")
# Draw the chart
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment