on-internet
← Community

Plotting multiple pie charts in a single figure

Stack Overflow ·

these are my columns: SeniorCitizen Partner Dependent Yes Yes No No Yes No No No Yes Yes No No I wanted to plot separate pie charts of all these columns in a single figure or sheet. This is my code: ax1 = df2['SeniorCitizen'].value_counts().plot(kind='pie', figsize=(5,5), fontsize=10, labels = ['No', 'Yes'], autopct='%1.0f%%') ax1.set_title('% of Senior Citizens', fontsize = 12) plt.show() ax2 = df2['Partner'].value_counts().plot(kind='pie', figsize=(5,5), fontsize=10, autopct='%1.0f%%') ax2.set_title('% of People with and without partner', fontsize = 12) plt.show() ax2 = df2['Dependents'].val

Comments

Sign in or sign up to comment and upvote.

No comments yet.