import numpy as np
import matplotlib.pyplot as plt 
mu,sigma = 2,0.5
v = np.random.normal(mu,sigma,10000)
plt.hist(v,bins=50,density=1)
plt.show()

Python Numpy matplotlib Histograms 直方图

import numpy as np
import matplotlib.pyplot as plt 
mu,sigma = 2,0.5
v = np.random.normal(mu,sigma,10000)
(n,bins) = np.histogram(v,bins=50,density=True)
plt.plot(.5*(bins[1:]+bins[:-1]),n)
plt.show()

Python Numpy matplotlib Histograms 直方图

相关文章:

  • 2021-05-17
  • 2021-04-30
  • 2021-07-17
  • 2021-10-01
  • 2022-01-13
  • 2021-07-09
  • 2022-12-23
  • 2021-06-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-05
  • 2022-12-23
  • 2022-01-09
  • 2022-01-04
  • 2021-12-10
相关资源
相似解决方案