text_plain_output_1.png
import matplotlib.pyplot as plt

labels_house = ['yes', 'no', 'unknown']
sizes_house = [2175, 1839, 105]
colors_house = ['#ff6666', '#ffcc99', '#ffb3e6']
labels_loan = ['yes', 'no', 'unknown']
sizes_loan = [665, 3349, 105]
colors_loan = ['#c2c2f0', '#ffb3e6', '#66b3ff']
labels_contact = ['cellular', 'telephone']
sizes_contact = [2652, 1467]
colors_contact = ['#ff9999', '#ffcc99']
labels_default = ['no', 'unknown', 'yes']
sizes_default = [3523, 454, 142]
colors_default = ['#99ff99', '#66b3ff', '#ff6666']
plt.rcParams.update({'font.size': 15})
plt.figure(0)
plt.pie(sizes_house, labels=labels_house, colors=colors_house, autopct='%1.1f%%', startangle=90, pctdistance=0.8)
plt.title('Housing Loan')
centre_circle = plt.Circle((0, 0), 0.5, color='black', fc='white', linewidth=0)
fig = plt.gcf()
fig.gca().add_artist(centre_circle)
plt.show()
plt.figure(1)
plt.pie(sizes_loan, labels=labels_loan, colors=colors_loan, autopct='%1.1f%%', startangle=90, pctdistance=0.8)
plt.title('Personal Loan')
centre_circle = plt.Circle((0, 0), 0.5, color='black', fc='white', linewidth=0)
fig = plt.gcf()
fig.gca().add_artist(centre_circle)
plt.show()
plt.figure(2)
plt.pie(sizes_contact, labels=labels_contact, colors=colors_contact, autopct='%1.1f%%', startangle=90, pctdistance=0.8)
plt.title('Contact Method')
centre_circle = plt.Circle((0, 0), 0.5, color='black', fc='white', linewidth=0)
fig = plt.gcf()
fig.gca().add_artist(centre_circle)
plt.show()
plt.figure(3)
plt.pie(sizes_default, labels=labels_default, colors=colors_default, autopct='%1.1f%%', startangle=90, pctdistance=0.8)
plt.title('default')
centre_circle = plt.Circle((0, 0), 0.5, color='black', fc='white', linewidth=0)
fig = plt.gcf()
fig.gca().add_artist(centre_circle)
plt.show()