Skip to content

Commit d3f8b1e

Browse files
arikpamnanilesteve
authored andcommitted
Use X and y in plot_lle_digits.py (#10970)
rather than digits.data and digits.target
1 parent b007b92 commit d3f8b1e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/manifold/plot_lle_digits.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ def plot_embedding(X, title=None):
4848
plt.figure()
4949
ax = plt.subplot(111)
5050
for i in range(X.shape[0]):
51-
plt.text(X[i, 0], X[i, 1], str(digits.target[i]),
51+
plt.text(X[i, 0], X[i, 1], str(y[i]),
5252
color=plt.cm.Set1(y[i] / 10.),
5353
fontdict={'weight': 'bold', 'size': 9})
5454

5555
if hasattr(offsetbox, 'AnnotationBbox'):
5656
# only print thumbnails with matplotlib > 1.0
5757
shown_images = np.array([[1., 1.]]) # just something big
58-
for i in range(digits.data.shape[0]):
58+
for i in range(X.shape[0]):
5959
dist = np.sum((X[i] - shown_images) ** 2, 1)
6060
if np.min(dist) < 4e-3:
6161
# don't show points that are too close

0 commit comments

Comments
 (0)