Package: ape
-Version: 2.7-1
-Date: 2011-03-26
+Version: 2.7-2
+Date: 2011-03-29
Title: Analyses of Phylogenetics and Evolution
Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong, Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel, Christoph Heibl, Daniel Lawson, Vincent Lefort, Pierre Legendre, Jim Lemon, Yvonnick Noel, Johan Nylander, Rainer Opgen-Rhein, Klaus Schliep, Korbinian Strimmer, Damien de Vienne
Maintainer: Emmanuel Paradis <Emmanuel.Paradis@ird.fr>
-## plot.phylo.R (2011-03-23)
+## plot.phylo.R (2011-03-29)
## Plot Phylogenies
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
-plot.phylo <- function(x, type = "phylogram", use.edge.length = TRUE,
- node.pos = NULL, show.tip.label = TRUE,
- show.node.label = FALSE, edge.color = "black",
- edge.width = 1, edge.lty = 1, font = 3, cex = par("cex"),
- adj = NULL, srt = 0, no.margin = FALSE,
- root.edge = FALSE, label.offset = 0, underscore = FALSE,
- x.lim = NULL, y.lim = NULL, direction = "rightwards",
- lab4ut = "horizontal", tip.color = "black", ...)
+plot.phylo <-
+ function(x, type = "phylogram", use.edge.length = TRUE,
+ node.pos = NULL, show.tip.label = TRUE,
+ show.node.label = FALSE, edge.color = "black",
+ edge.width = 1, edge.lty = 1, font = 3, cex = par("cex"),
+ adj = NULL, srt = 0, no.margin = FALSE, root.edge = FALSE,
+ label.offset = 0, underscore = FALSE, x.lim = NULL,
+ y.lim = NULL, direction = "rightwards", lab4ut = "horizontal",
+ tip.color = "black", draw = TRUE, ...)
{
Ntip <- length(x$tip.label)
if (Ntip == 1) {
}
asp <- if (type %in% c("fan", "radial", "unrooted")) 1 else NA # fixes by Klaus Schliep (2008-03-28 and 2010-08-12)
plot(0, type = "n", xlim = x.lim, ylim = y.lim, ann = FALSE, axes = FALSE, asp = asp, ...)
+
+if (draw) {
if (is.null(adj))
adj <- if (phyloORclado && direction == "leftwards") 1 else 0
if (phyloORclado && show.tip.label) {
}
if (direction == "leftwards") {
lox <- -label.offset - MAXSTRING * 1.05 * (1 - adj)
- #xx <- xx + MAXSTRING
+ ##xx <- xx + MAXSTRING
}
if (!horizontal) {
psr <- par("usr")
if (show.node.label)
text(xx[ROOT:length(xx)] + label.offset, yy[ROOT:length(yy)],
x$node.label, adj = adj, font = font, srt = srt, cex = cex)
+}
L <- list(type = type, use.edge.length = use.edge.length,
node.pos = node.pos, show.tip.label = show.tip.label,
show.node.label = show.node.label, font = font,
cex = par("cex"), adj = NULL, srt = 0, no.margin = FALSE,
root.edge = FALSE, label.offset = 0, underscore = FALSE,
x.lim = NULL, y.lim = NULL, direction = "rightwards",
- lab4ut = "horizontal", tip.color = "black", ...)
+ lab4ut = "horizontal", tip.color = "black", draw = TRUE, ...)
\method{plot}{multiPhylo}(x, layout = 1, ...)
}
\arguments{
\code{type = "unrooted"}.}
\item{tip.color}{the colours used for the tip labels, eventually
recycled (see examples).}
+ \item{draw}{a logical controlling whether to draw the tree. If
+ \code{FALSE}, the graphical device is set as if the tree was
+ plotted, and the coordinates are saved as well.}
\item{layout}{the number of trees to be plotted simultaneously.}
\item{\dots}{further arguments to be passed to \code{plot} or to
\code{plot.phylo}.}