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()