In umap, I'm trying to make multiple colors with this code in google colab, but only one…
Private research annotation
Sign in to add a private research label or note.
- User
In umap, I'm trying to make multiple colors with this code in google colab, but only one color prints out, help fix: plt.figure(figsize=(10, 5)) plt.scatter(umap_results[:, 0], umap_results[:, 1]) colors = 'rbg' plt.xticks([]) plt.yticks([]) plt.axis('off') plt.show()
- Assistant
To assign different colors to each data point based on some categorical variable, you need to pass a list or an array of colors to the
cparameter of thescatterfunction.Assuming you have a categorical variable
categorieswithnunique values, you can create a list ofncolors and then index into that list using thecategoriesvariable to get the color for each data point. Here's how you can modify your code:python
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.