【发布时间】:2015-10-14 07:04:27
【问题描述】:
我需要从通过卷积输入数组和过滤器获得的二维数组创建直方图。 bins 应该是数组中值的范围。
我试着按照这个例子:How does numpy.histogram() work? 代码是这样的:
import matplotlib.pyplot as plt
import numpy as np
plt.hist(result, bins = (np.min(result), np.max(result),1))
plt.show()
我总是收到此错误消息:
AttributeError: bins must increase monotonically.
感谢您的帮助。
【问题讨论】:
-
如果你看
(np.min(result), np.max(result),1),值会单调增加吗? -
我的例子的最小值/最大值是:'(0.0, 254.999999745)'
标签: python arrays numpy histogram