如何在圆形树状图中修复重叠的标签?

时间:2018-12-13 21:39:01

标签: r cluster-analysis dendrogram dendextend

我运行此代码是为了获得一个环形树状图,但事实是标签重叠且全黑。

Picture

这是我用来生成图形的代码:

library(dendextend)
library(circlize)

load(file = "hc1.rda")
#out1 <- cutree(hc1, k = 50)
load(file = "out1.rda")

dend <- as.dendrogram(hc1)
dorder <- order.dendrogram(dend)

colrs = colorRampPalette(c("blue", "red"))( 50)
library(colorBrewer)
# modify the dendrogram to have some colors in the branches and labels
dend1 <- color_branches(dend, col=colrs , 
                        clusters=out1)
plot(dend1)

# plot the radial plot
par(mar = rep(0,4))
# circlize_dendrogram(dend, dend_track_height = 0.8) 
circlize_dendrogram(dend1, labels_track_height = NA, 
                    dend_track_height = .4, labels = TRUE) 

0 个答案:

没有答案