def plot_example(self, x, y, clusters, length):
plt.figure(0)
plt.clf()
colors = cm.rainbow(np.linspace(0, 1, clusters))
for c in range(clusters):
ind = np.where(y == c)[0]
plt.scatter(x[ind, 0], x[ind, 1], c=colors[c])
path = '/home/anowak/DynamicProgramming/DP/plots/example.png'
plt.savefig(path)
评论列表
文章目录