unable to change pie chart size in pie() in matplotllnb

62 views Asked by At
import pandas as pd 
import numpy as np 
df = pd.read_csv("Medals.csv")
import matplotlib.pyplot as plt
fig=plt.figure()
plt.suptitle("Medals data")
x = sum(df.Gold)
y = sum(df.Silver)
z = sum(df.Bronze)
y = np.array([x,y,z])
mylabels = ["Gold", "Silver", "Bronze"]
plt.pie(y,labels = mylabels,startangle=0,autopct='%1.1f%%')
plt.axis('equal')
plt.legend(["Gold","Silver","Bronze"],loc ="lower right")
fig.savefig("plot7.png")

This is my code. I want to adjust pie plot inside the same fig size but no i m unable to do so. Kindly help me with this. Also i m new to matplotlib Want result like this Result of my code

I tried to using figsize but it changed the whole figure and also i tried radius but no change in savefig.

0

There are 0 answers