python数据可视化学习-直方图
import numpy as np
import matplotlib.pyplot as plt
mu = 1000
sigma = 10
x = mu + sigma*np.random.randn(2000)
plt.hist(x,bins=10,color='red',normed=True)
plt.show()
但是图里面没有边框
import numpy as np
import matplotlib.pyplot as plt
mu = 1000
sigma = 10
x = mu + sigma*np.random.randn(2000)
plt.hist(x,bins=10,color='red',normed=True,edgecolor='k')
plt.show()
import numpy as np
import matplotlib.pyplot as plt
x = np.random.randn(1000)+2
y = np.random.randn(1000)+3
plt.hist2d(x,y,bins=40)
plt.show()