我希望完成兩件事。
我希望能夠旋轉標簽。該
fviz_dend功能與功能兼容,ggplot2theme但我不完全確定如何完成它。我想更改樹狀圖的線條顏色 - 特別是那些不屬于聚類的線條顏色。我想把黑色改成白色。
知道如何在這個 reprex 上完成它嗎?
df <- scale(mtcars) # Standardize the data
library("factoextra")
library("cluster")
dist <- dist(df, method = "euclidean") # df = standardized data
hc <- hclust(dist, method = "ward.D2")
fviz_dend(hc, k = 4, # Cut in four groups
cex = 0.6, # label size
k_colors = "lancet",
color_labels_by_k = TRUE, # color labels by groups
rect = TRUE, # Add rectangle around groups
rect_border = "lancet",
rect_fill = TRUE,
rotate = TRUE)
ggplot2::theme_dark()
#> Warning: `guides(<scale> = FALSE)` is deprecated. Please use `guides(<scale> =
#> "none")` instead.

由
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/443253.html
上一篇:調整ggplot物件的線條大小
下一篇:將面積圖的圖例放在圖中
