Using plt.hist()
, you need to create the histogram using the argument histtype="stepfilled"
and set the edgecolor
of the patches, which is by default set to None, in order to get the histogram the way you desire:
import numpy as np
import matplotlib.pyplot as plt
data = np.random.randn(10000)
plt.hist(data, histtype="stepfilled", edgecolor='k', linewidth=1.2)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.