尝试绘制剪影图,但我得到以下错误。
代码:
plt.barh(range(y_ax_lower, y_ax_upper),
c_silhouette_vals,
height= 1.0,
edgecolor = 'none',
color = color)
c_silhouette_vals是一个数组。
错误:
C:****-
packages\matplotlib\axes\_axes.py in bar(self, left, height, width, bottom,
**kwargs)
2039 if len(width) != nbars:
2040 raise ValueError("incompatible sizes: argument 'width' "
-> 2041 "must be length %d or scalar" % nbars)
2042 if len(bottom) != nbars:
2043 raise ValueError("incompatible sizes: argument 'bottom' "
ValueError: incompatible sizes: argument 'width' must be length 0 or scalar