Could someone please help me in converting the below bar chart created in matplotlib to plotly with labels appearing on hover.
df_scaled
is the dataset name and selected_columns
is the list of variables and kmeans is the predicted output
# Plot data
tidy = df_scaled[selected_columns+['kmeans']].melt(id_vars='kmeans')
fig, ax = plt.subplots(figsize=(15, 5))
sns.barplot(x='kmeans', y='value', hue='variable', data=tidy, palette='Set3')
plt.legend(loc='upper right')
#plt.savefig('randomforest.jpg', dpi=300)
plt.savefig("Clustering_Restricted_features.jpg", dpi=300)
Please find the attached image of the plot for the above code
The ultimate aim here is to make the chart interactive with labels on hover using plotly.
question from:
https://stackoverflow.com/questions/65876659/replicate-png-chart-in-plotly 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…