I've tried to set the colors in fviz_silhouette with transparency to achieve a more beautiful look:
library(factoextra)
library(cluster)
set.seed(123)
data("iris")
iris.scaled <- scale(iris[, -5])
# K-means clustering
km.res <- kmeans(iris.scaled, 3, nstart = 2)
# Visualize silhouhette information
sil <- silhouette(km.res$cluster, dist(iris.scaled))
fviz_silhouette(sil) +
scale_color_manual('', values = c("#008B4544", "#FF000033", "#1C86EE44"), aesthetics = c("color", "fill")) + # change color
theme(panel.background = element_blank(), #try to remove the lines, dosen′t work......
panel.grid.major = element_blank(),
panel.grid.minor = element_blank())
Unfortunately, some vlines have appeared (see image below). I don’t know why this has happened. Perhaps it's related to the distance between grid lines? How I can remove these lines?
question from:https://stackoverflow.com/questions/65861244/remove-grid-in-fviz-silhouette