0

The following figure is a t-sne scatter plot of a batch of numpy image arrays, which is of shape (2500,64,64,1). How do I replace each blue dot on the figure with the its own original image?

I used the following code to draw the figure:

from sklearn.manifold import TSNE

tsne = TSNE(n_components=2).fit_transform(images)
# plot the result
vis_x = tsne[:, 0]
vis_y = tsne[:, 1]

plt.figure(figsize = (160,120))
plt.scatter(vis_x, vis_y)
plt.show()

t-sne scatter plot of the images arrays

jabberwoo
  • 491
  • 6
  • 18
  • No, it doesn't. My data type is np.array, but the link has images of .jpg data type, they have different specs. – jabberwoo Jun 08 '20 at 17:03
  • 2
    @jabberwoo `plt.imshow` accepts a 2D array, so that the code in the linked question should work fine. – bnaecker Jun 08 '20 at 17:36

0 Answers0