I have a function in which returns scatterplot of a Isomap <https://en.wikipedia.org/wiki/Isomap>function, which takes output from a TF-IDF <https://en.wikipedia.org/wiki/Tf%E2%80%93idf> function, which calculated TF-IDF values of certain articles online. I used four articles and I want to show the 4 articles by a 3D scatterplot.
Below is the function to turn my Isomap values to a 3D scatterplot : def Isomap(tfidf): jon = pd.read_csv(tfidf) le = preprocessing.LabelEncoder() tims = jon.apply(le.fit_transform) iso = manifold.Isomap(n_neighbors=2, n_components=3) john = iso.fit_transform(tims) fig = plt.figure() ax = fig.add_subplot(111, projection='3d') use_colors = 'rybg' ax.scatter(john[:,0], john[:,1],john[:,2],color=use_colors,alpha=.5) # x,y,z coord. jon 1-3 plt.title('Isomap of candiates') plt.xlabel('x') plt.ylabel('y') plt.show() plt.savefig('isomap.png') The problem is that I usually only get one color returned. And even if I get the code to print out 4 colors, I'm not sure how to get those colors to correspond to the four web articles. Thanks for the help in advance. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor