Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 存储箱matplotlib的范围_Python_Matplotlib - Fatal编程技术网

Python 存储箱matplotlib的范围

Python 存储箱matplotlib的范围,python,matplotlib,Python,Matplotlib,我想用matplotlib绘制直方图。 我只是想知道如何设置范围(提供给存储箱的列表或数组包含直方图存储箱的边缘。因此,您可以创建一个从结果中的最小值到9.0的存储箱 bins = [np.min(results)] + range(9, np.max(results), 1) plt.hist(results, bins=bins) 您的解决方案出了什么问题?您需要忽略0.9和9.0之间的值吗?还是输入错误?在DYZ,我不知道如何计算小于9.0的int帐户值。 bins = [np.min(

我想用matplotlib绘制直方图。
我只是想知道如何设置范围
(提供给
存储箱的列表或数组包含直方图存储箱的边缘。因此,您可以创建一个从
结果中的最小值到
9.0
的存储箱

bins = [np.min(results)] + range(9, np.max(results), 1)
plt.hist(results, bins=bins)

您的解决方案出了什么问题?您需要忽略0.9和9.0之间的值吗?还是输入错误?在DYZ,我不知道如何计算小于9.0的int帐户值。
bins = [np.min(results)] + range(9, np.max(results), 1)
plt.hist(results, bins=bins)