在使用matplotlib的python中,当进行直方图时,如何确定每个容器的起点和终点?

2024-04-19 14:59:33 发布

您现在位置:Python中文网/ 问答频道 /正文

在使用matplotlib的python中,当进行直方图时,如何确定每个容器的起点和终点

https://colab.research.google.com/drive/1k00d1OhIUwcBl1zetXtKXBVvuNS8FYpL

import matplotlib.pyplot as plt

x = [1,1,2,3,3,3,3,3,3,5]

plt.hist(x, bins=5)

如何计算每个箱子的起点和终点? 为什么第一个箱子从1开始,而最后一个箱子大约从4.25开始? 为什么其中一个垃圾箱的终点约为3.4

enter image description here


Tags: httpsimportcommatplotlibasgooglepltdrive