0
import matplotlib.pyplot as plt

import numpy as np

plt.title("Score analysis:")

size = ["60", "40", "43", "20", "45"]

labels = ["Maths", "Hindi", "English", "Social", "Science"]

plt.pie(size, labels = labels, autopct="%.2f%%")

plt.show()

I know that "autopct" displays the percentage of a given value as well as shift decimals. But how it gets to know how much area is to be covered in the pie chart for any label , say "Math" , what's the calculation behind it?

Bill Lynch
  • 80,138
  • 16
  • 128
  • 173
Aryan
  • 21
  • 1
  • 4
  • Is this topic answered your question? https://stackoverflow.com/questions/6170246/how-do-i-use-matplotlib-autopct – RoyalGoose Jun 06 '21 at 21:06
  • @RoyalGoose No , I actually saw that alot of times , but it doesn't tell the "calculations" , it just tells the definition. My question was ,how it gets to know about the area covered for each labels? – Aryan Jun 07 '21 at 01:55
  • @RoyalGoose And even in the second bunch of code , I was not able to get exactly, what it meant , I have many questions regarding it , like why we use "%" in it , what does it do? Any math or calculation? Like in a more clear way. – Aryan Jun 07 '21 at 02:03

0 Answers0