|
@@ -36,17 +36,17 @@ if __name__ == '__main__':
|
|
|
colors = [plt.cm.Spectral(each)
|
|
|
for each in np.linspace(0, 1, len(unique_labels))]
|
|
|
for k, col in zip(unique_labels, colors):
|
|
|
- if k == -1:
|
|
|
- # Black used for noise.
|
|
|
- col = [0, 0, 0, 1]
|
|
|
+ if k == -1:
|
|
|
+ # Black used for noise.
|
|
|
+ col = [0, 0, 0, 1]
|
|
|
|
|
|
- class_member_mask = (labels == k)
|
|
|
+ class_member_mask = (labels == k)
|
|
|
|
|
|
- xy = x[class_member_mask & core_samples_mask]
|
|
|
- plt.plot(xy[:, 0], xy[:, 1], 'o', markerfacecolor=tuple(col),
|
|
|
- markeredgecolor='k', markersize=14)
|
|
|
+ xy = x[class_member_mask & core_samples_mask]
|
|
|
+ plt.plot(xy[:, 0], xy[:, 1], 'o', markerfacecolor=tuple(col),
|
|
|
+ markeredgecolor='k', markersize=14)
|
|
|
|
|
|
- xy = x[class_member_mask & ~core_samples_mask]
|
|
|
- plt.plot(xy[:, 0], xy[:, 1], 'o', markerfacecolor=tuple(col),
|
|
|
- markeredgecolor='k', markersize=6)
|
|
|
+ xy = x[class_member_mask & ~core_samples_mask]
|
|
|
+ plt.plot(xy[:, 0], xy[:, 1], 'o', markerfacecolor=tuple(col),
|
|
|
+ markeredgecolor='k', markersize=6)
|
|
|
plt.show()
|