python可视化直方图的代码

import numpy as np
import matplotlib.pyplot as plt

mu = 100 #mean of distribution
sigma = 20 # standard deviation of distribution
x = mu + sigma * np.random.randn(2000)

plt.hist(x,bins=50,color=‘green’,normed=False,edgecolor=‘k’)
plt.show()

猜你喜欢

转载自blog.csdn.net/weixin_44056948/article/details/86486713
今日推荐