pie chart python pandas
df = pd.DataFrame({'mass': [0.330, 4.87 , 5.97],
'radius': [2439.7, 6051.8, 6378.1]},
index = ['Mercury', 'Venus', 'Earth'])
plot = df.plot.pie(y='mass', figsize=(5, 5))
pie chart python pandas
df = pd.DataFrame({'mass': [0.330, 4.87 , 5.97],
'radius': [2439.7, 6051.8, 6378.1]},
index = ['Mercury', 'Venus', 'Earth'])
plot = df.plot.pie(y='mass', figsize=(5, 5))
How to Create a Pie Chart in Seaborn
Pie chart in Seaborn
import matplotlib.pyplot as plt
import seaborn as sns
# car sales data
total_sales = [3000, 2245, 1235, 5330, 4200]
explode = [0, 0, 0, 0.2, 0]
location = ['Bangalore', 'Delhi', 'Chennai', 'Mumbai', 'Kolkatta']
# Seaborn color palette to plot pie chart
colors = sns.color_palette('bright')
# create pie chart using matplotlib
plt.pie(total_sales, labels=location, colors=colors,
autopct='%.0f%%', explode=explode, shadow=True, rotatelabels='true')
plt.show()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us