3 ## Zoom on a Portion of a Phylogeny
5 ## Copyright 2003-2008 Emmanuel Paradis
7 ## This file is part of the R-package `ape'.
8 ## See the file ../COPYING for licensing issues.
10 zoom <- function(phy, focus, subtree = FALSE, col = rainbow, ...)
12 if (!is.list(focus)) focus <- list(focus)
15 if (is.character(focus[[i]]))
16 focus[[i]] <- which(phy$tip.label %in% focus[[i]]) # fix by Yan Wong
18 if (deparse(substitute(col)) == "grey")
19 col <- grey(1:n/n) else col <- col(n)
23 ext[[i]] <- drop.tip(phy, phy$tip.label[-focus[[i]]],
25 nc <- round(sqrt(n)) + 1
26 nr <- ceiling(sqrt(n))
27 M <- matrix(0, nr, nc)
28 x <- c(rep(1, nr), 2:(n + 1))
30 layout(M, c(1, rep(3/(nc - 1), nc - 1)))
31 phy$tip.label <- rep("", length(phy$tip.label))
32 colo <- rep("black", dim(phy$edge)[1])
34 colo[which.edge(phy, focus[[i]])] <- col[i]
35 plot.phylo(phy, edge.color = colo, ...)
37 plot.phylo(ext[[i]], edge.color = col[i], ...)