plt.rcParams['font.family']='SimHei'
plt.rcParams['font.size']=20
# 直方图
mu = 100
sigma = 20
x = np.random.normal(100,20,100) # 均值和标准差
plt.hist(x,bins=20,color='red',histtype='stepfilled',alpha=0.75)
plt.title('直方图数据分析与展示')
plt.show()
注意,在 plt.show() 之前调用 plt.savefig()
留言