import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
heart = pd.read_csv('C:/Users/Mac/Desktop/heart.csv')
colors=['tomato','lightskyblue']
countNoDisease = len(heart[heart['target']==0])
countHaveDisease = len(heart[heart['target']==1])
total = len(heart['target'])
rateNo = countNoDisease/total100
rateHave = countHaveDisease/total100
diseaseRate = pd.Series({'正常':countNoDisease, '患病': countHaveDisease})
plt.bar(diseaseRate.index,diseaseRate.values,color='lightskyblue')
plt.title('患病和正常人群分布',fontsize=14)
plt.xlabel('是否患病',fontsize=12)
plt.ylabel('人数',fontsize=12)
plt.ylim([0,200])
plt.show()
运行出来是这样
为什么那些数据标签比如title和xy轴坐标都是空白框框,要怎么改进?麻烦给出代码