hist用法和可视化效果,会持续更新

time:20181003 --> mark:set_title()带入变量

import numpy as np
import matplotlib.pyplot as plt

mu = 100
sigma = 15
x = np.random.normal(mu, sigma, 10000)

plt.figure(figsize=(12,8))
ax = plt.gca()
# the histogram of the data
ax.hist(x, bins=35, color='g')

ax.set_xlabel('Values')
ax.set_ylabel('Frequency')
ax.grid()
ax.set_title(r'$\mathrm{Histogram:}\ \mu=%d,\ \sigma=%d$' % (mu, sigma))

plt.show()
plt.hist函数案例一则
直方图案例一

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2021-08-01
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
猜你喜欢
  • 2021-09-19
  • 2021-04-25
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
  • 2021-09-19
  • 2022-02-25
相关资源
相似解决方案