library(ggtree)
library(ggstance)
# generate tree
tr <- rtree(30)
# create simple ggtree object with tip labels
p <- ggtree(tr) + geom_tiplab(offset = 0.02)
# Generate distribution of points for each species
d4 <- data.frame(id=rep(tr$tip.label, each=20),
val=as.vector(sapply(1:30, function(i)
rnorm(20, mean=i))))
# Create panel with boxplot of the d4 data
p4 <- facet_plot(p, panel="Range", data=d4, geom_text(
mapping = aes(x=val, group=label, color=location))
plot(p4)
我上面的ggtree带facet_plot。我想再添加两个方面:一个具有最小值和最大值,另一个具有观察值数量。有办法吗?