plt.scatter(X[0, :], X[1, :], c=Y, s=40, cmap=plt.cm.Spectral)出错

plt.scatter(X[0, :], X[1, :], c=Y, s=40, cmap=plt.cm.Spectral)出错

ValueError: c of shape (1, 400) not acceptable as a color sequence for x with size 400, y with size 400
# Visualize the data:
plt.scatter(X[0, :], X[1, :], c=Y.reshape(400), s=40, cmap=plt.cm.Spectral);

Y改成Y.reshape(400)

posted @ 2019-01-19 12:28 douzujun 阅读( ...) 评论( ...) 编辑 收藏

你可能感兴趣的:(plt.scatter(X[0, :], X[1, :], c=Y, s=40, cmap=plt.cm.Spectral)出错)