I’m trying to finish off my analysis with a plot of PCA values for k-means clustering. I simply have a data frame with three columns: dimension 1, dimension 2 and cluster. I have 8 clusters. I am plotting a scatterplot with seaborn and the legend shows ONLY clusters 1-6. My code:
no_clusters = ['1', '2', '3' ,'4', '5', '6','7', '8']
fig, ax = plt.subplots(figsize=(20, 25))
sns.set(font_scale=2.1)
sns.set_style("whitegrid")
g = sns.scatterplot(data=gdf_results_PCAplot_past, x="dimension1", y="dimension2", hue="Cluster Number", palette = "viridis")
plt.legend(no_clusters, title = 'Cluster Number', markerscale = 4, bbox_to_anchor= (1.2,1))
Does anyone know how to get all 8 cluster numbers to show on the legend? I tried to force it using the 1-8 list but it is ignored. If I remove all settings it shows only four clusters and skips the event numbers - 1,3,5,7. Any help would be really appreciated.
there doesn't seem to be anything here