8000 DOC make `plot_mean_shift.py` more colourblind friendly (#24553) · glemaitre/scikit-learn@389cfd5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 389cfd5

Browse files
rprkhglemaitre
authored andcommitted
DOC make plot_mean_shift.py more colourblind friendly (scikit-learn#24553)
1 parent 3f8bf59 commit 389cfd5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/cluster/plot_mean_shift.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,21 @@
4242
# Plot result
4343
# -----------
4444
import matplotlib.pyplot as plt
45-
from itertools import cycle
4645

4746
plt.figure(1)
4847
plt.clf()
4948

50-
colors = cycle("bgrcmyk")
49+
colors = ["#dede00", "#377eb8", "#f781bf"]
50+
markers = ["x", "o", "^"]
51+
5152
for k, col in zip(range(n_clusters_), colors):
5253
my_members = labels == k
5354
cluster_center = cluster_centers[k]
54-
plt.plot(X[my_members, 0], X[my_members, 1], col + ".")
55+
plt.plot(X[my_members, 0], X[my_members, 1], markers[k], color=col)
5556
plt.plot(
5657
cluster_center[0],
5758
cluster_center[1],
58-
"o",
59+
markers[k],
5960
markerfacecolor=col,
6061
markeredgecolor="k",
6162
markersize=14,

0 commit comments

Comments
 (0)
0