# \donttest{
old.par <- par(no.readonly = TRUE)
require(ape)
data(africa)
par(mai=rep(0,4))
plot(africa$phylo, type = "fan", show.tip.label=FALSE,
open.angle = 180, edge.width=0.5)
y <- data.frame(species=africa$phylo$tip.label)
y$genus <- gsub("_.*", "\\1", y$species)
fx <- split(y, f=y$genus)
suppressWarnings(invisible(lapply(fx, function(x) {
y <- seq(from = 1.03, to = 1.09, by = ((1.09 - 1.03)/(length(fx) - 1)))
z <- sample(y, 1, replace = FALSE, prob = NULL)
if(nrow(x) > 10L) arc_labels(phy = africa$phylo, tips=x$species,
text=as.character(unique(x$genus)),
orientation = "curved", cex=0.5,
lab.offset = z)
})))
par(old.par)
# }
Run the code above in your browser using DataLab