PLOT <- function(dendr){ ggplot() + geom_segment(data=segment(dendr), aes(x=x, y=y, xend=xend, yend=yend)) + geom_text(data=label(dendr), aes(x, y, label=label, hjust=0, color=cluster), size=3) + scale_y_reverse(expand=c(0.2, 0)) + theme(axis.line.y=element_blank(), axis.ticks.y=element_blank(), axis.text.y=element_blank(), axis.title.y=element_blank(), panel.background=element_rect(fill="white"), panel.grid=element_blank()) } PLOT2 <- function(dendr){ ggplot() + geom_segment(data=segment(dendr), aes(x=x, y=y, xend=xend, yend=yend)) + geom_text(data=label(dendr), aes(x, y, label=label, hjust=0, color=cluster), size=3) + coord_flip() + scale_y_reverse(expand=c(0.2, 0)) + theme(axis.line.y=element_blank(), axis.ticks.y=element_blank(), axis.text.y=element_blank(), axis.title.y=element_blank(), panel.background=element_rect(fill="white"), panel.grid=element_blank()) }
|