📄 histogram_demo.py
字号:
#!/usr/bin/env pythonfrom pylab import *mu, sigma = 100, 15x = mu + sigma*randn(10000)# the histogram of the datan, bins, patches = hist(x, 50, normed=1)setp(patches, 'facecolor', 'g', 'alpha', 0.75)# add a 'best fit' liney = normpdf( bins, mu, sigma)l = plot(bins, y, 'r--')setp(l, 'linewidth', 1)xlabel('Smarts')ylabel('Probability')title(r'$\rm{Histogram\ of\ IQ:}\ \mu=100,\ \sigma=15$')axis([40, 160, 0, 0.03])grid(True)#savefig('histogram_demo',dpi=72)show()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -