1、Build a histogram

In [1]: help(plt.hist)
Help on function hist in module matplotlib.pyplot: hist(x, bins=10, range=None, normed=False, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, color=None, label=None, stacked=False, hold=None, data=None, **kwargs)
Plot a histogram.

# Create histogram of life_exp data
plt.hist(life_exp); # Display histogram
plt.show()

2、Bins

# Build histogram with 5 bins
plt.hist(life_exp, bins = 5) # Show and clean up plot
plt.show()
plt.clf() # Build histogram with 20 bins
plt.hist(life_exp, bins = 20) # Show and clean up again
plt.show()
plt.clf()

3、Compare

# Histogram of life_exp, 15 bins
plt.hist(life_exp, bins = 15) # Show and clear plot
plt.show()
plt.clf() # Histogram of life_exp1950, 15 bins
plt.hist(life_exp1950, bins = 15) # Show and clear plot again
plt.show()
plt.clf()

最新文章

  1. Python:Pycharm下无法导入安装好的第三方模块?
  2. Codeforces Round #254 (Div. 2) A DZY Loves Chessboard
  3. go语言 类型:整型
  4. Date类型和Long类型的相互转换
  5. Android强大的开源库与系统架构工具
  6. ubuntu 基本操作(1)
  7. 全面理解 ASP.NET Core 依赖注入
  8. iOS中 基于LBXScan库二维码扫描 韩俊强的博客
  9. Excel 恢复默认行高、列宽
  10. docker搭建elk
  11. Day03 - Ruby比一比:Module的include与extend
  12. VS2015环境下生成和调用DLL动态链接库
  13. 模拟开户接口,使用python脚本实现批量用户开通
  14. python 错误: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)
  15. 【九天教您南方cass 9.1】 03 编码法绘制地形图
  16. NumPy 排序、条件刷选函数
  17. Codeforces914G Sum the Fibonacci(FWT)
  18. Python学习笔记(九)—— 函数
  19. Linux vi编辑器的使用
  20. C和C++中的不定参数

热门文章

  1. C#中的方法,方法的重载,以及几个关键字
  2. iOS底层音频处理技术(带源代码)
  3. PyQt4预定义对话框
  4. JSP自定义标签rtexprvalue属性
  5. c++字符指针
  6. MQTT协议笔记之发布流程
  7. Android DatepickerDialog(日期选择器)的使用
  8. 扫描类APP推荐
  9. ubuntu16.04下安装pcl点云库
  10. 利用maven-assembly-plugin加载不同环境所需的配置文件及使用场景