美文网首页
Matplotlib: histplot

Matplotlib: histplot

作者: LET149 | 来源:发表于2023-08-17 08:59 被阅读0次
import matplotlib.pyplot as plt
import numpy as np

plt.style.use('_mpl-gallery')

# make data
np.random.seed(1)
x = 4 + np.random.normal(0, 1.5, 200)

# plot:
fig, ax = plt.subplots()

ax.hist(x, bins=8, linewidth=0.5, edgecolor="white")

ax.set(xlim=(0, 8), xticks=np.arange(1, 8),
       ylim=(0, 56), yticks=np.linspace(0, 56, 9))

plt.show()
image.png

2. 参数

相关文章

网友评论

      本文标题:Matplotlib: histplot

      本文链接:https://www.haomeiwen.com/subject/ezulpdtx.html