简体   繁体   中英

How to rotate the plot in r base package graphics?

I know this is a little bit too much, but I am plotting a dendrogram plot in r, and here is my code:

dd <- dist(scale(full[,c(1,2,3,4)]),method="euclidean")
hc = hclust(dd,method="ward.D2")
dend <- color_branches(as.dendrogram(hc),6)

labels_colors(dend) <-
  rainbow_hcl(6)[sort_levels_values(
    as.numeric(classified[, 9])[order.dendrogram(dend)]
  )]
plot(dend,horiz=T)

and I got this plot: 在此处输入图像描述 Is there any way can do mirror symmetry to make it like this:(please ignore the difference in colour) 在此处输入图像描述

plot_horiz.dendrogram(dend, side = TRUE)

should do the trick. See https://rdrr.io/cran/dendextend/f/vignettes/FAQ.Rmd

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM