一、总结

一句话总结:

a=np.array([1,4,3,2,4,1,4,6,3,2,1,4,6])
plt.hist(a, bins=5, color='g', alpha=0.75)  # hist:绘制直方图
# 也就是1-2之间有几个数,2-3之间有几个数

 

 

二、matplotlib画直方图

转自或参考:

 

import numpy as np
import matplotlib.pyplot as plt
a=np.array([1,4,3,2,4,1,4,6,3,2,1,4,6])
plt.hist(a, bins=5, color='g', alpha=0.75)  # hist:绘制直方图
plt.grid()
plt.show()
# 也就是1-2之间有几个数,2-3之间有几个数等

matplotlib画直方图

 

 

 

相关文章:

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