我的 juypter 笔记本出现以下错误。我已将 mathplotlib 更新为最新版本,但仍然出现错误
'c' 参数看起来像一个单一的数字 RGB 或 RGBA 序列,应该避免这种情况,因为如果其长度与 'x' 和 'y' 匹配,则值映射将具有优先权。如果您真的想为所有点指定相同的 RGB 或 RGBA 值,请使用单行的二维数组。
X=lab3_data
range_n_clusters = [2, 3, 4, 5, 6,7,8]
for n_clusters in range_n_clusters:
# Create a subplot with 1 row and 2 columns
fig, (ax1, ax2) = plt.subplots(1, 2)
fig.set_size_inches(18, 7)
# The 1st subplot is the silhouette plot
# The silhouette coefficient can range from -1, 1 but in this example all
# lie within [-0.1, 1]
ax1.set_xlim([0, 1])
# The …Run Code Online (Sandbox Code Playgroud)