首页 > 解决方案 > 在使用 matplotlib 构建直方图时,在什么情况下会出现以下错误:ValueError: `bins` must be 1d, when an array

问题描述

我收到有关ValueError: `bins` must be 1d, when an array使用 matplotlib 构建直方图的错误。我想自己调试,只想要一个方向,所以我没有显示代码。

标签: python-3.xmatplotlibhistogram

解决方案


据我了解你的问题你桅杆使用不歇斯底里

insert_axes.bar(x = tips_per_day['day'], height = tips_per_day['max'], 
                width = 0.6, align = 'edge')
insert_axes.bar(x = tips_per_day['day'], height = tips_per_day['min'], 
                width = -0.6, align = 'edge')

推荐阅读