Python-Matplotlib 5 直方图

 

Good  http://blog.csdn.net/u013571243/article/details/48998619

 

Python-Matplotlib 6 直方图

 

 

 

Example 1 

import numpy as np
import matplotlib.pyplot as plt

mu = 100 # mean of distribution
sigma = 20 # standard deviation of distribution
x = mu + sigma * np.random.randn(2000)

plt.hist(x, bins=10 , color='m' ,)
# p1 : normal = True 
# p2 : ignore normal = True 
plt.show()

 

P1

Python-Matplotlib 6 直方图  

P2

Python-Matplotlib 6 直方图

 

Example 2 :

import numpy as np
import matplotlib.pyplot as plt

x = np.random.randn(1000) + 2
y = np.random.rand(1000) + 3
plt.hist2d(x,y ,bins=400)
plt.show()

 Python-Matplotlib 6 直方图

 

相关文章:

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