I am trying to plot legends for the attached image and I am unable to plot legend with my below query, Could someone please help me resolve this?
#Predicted Labels on PCA
pcadf = pd.DataFrame(preprocessed_data)
pcadf["kmeans"] = pipe["clusterer"]["kmeans"].labels_
pcadf.columns = ['component_1', 'component_2', 'kmeans']
x = pcadf['component_1'].values
y = pcadf['component_2'].values
Cluster = pcadf["kmeans"].values
fig = plt.figure(figsize=(10,5))
ax = fig.add_subplot(111)
scatter = ax.scatter(x,y,c=Cluster,s=50)
ax.legend()
fig.savefig('KMeans_Cluster.png', bbox_inches='tight', dpi=1200)

