【发布时间】:2016-08-09 19:09:10
【问题描述】:
我可以使用
创建树状图x<-1:100
dim(x)<-c(10,10)
set.seed(1)
groups<-c("red","red", "red", "red", "blue", "blue", "blue","blue", "red", "blue")
x.clust<-as.dendrogram(hclust(dist(x)))
x.clust.dend <- x.clust
labels_colors(x.clust.dend) <- groups
x.clust.dend <- assign_values_to_leaves_edgePar(x.clust.dend, value = groups, edgePar = "col") # add the colors.
x.clust.dend <- assign_values_to_leaves_edgePar(x.clust.dend, value = 3, edgePar = "lwd") # make the lines thick
plot(x.clust.dend)
但是我想删除左侧的高度信息比例如下图所示。
我的猜测是它应该非常微不足道,但我无法找到一种方法来做到这一点。我不想要的一种解决方案是使用ggplot2,如下所示:
ggplot(as.ggdend(dend2))
这是因为我会丢失一些格式,例如color_bars()
【问题讨论】:
-
试试这个:plot(x.clust.dend, yaxt="n")
标签: r visualization hierarchical-clustering dendrogram dendextend