]> git.donarmstrong.com Git - ape.git/blobdiff - R/plot.phylo.R
some updates for ape 3.0-7
[ape.git] / R / plot.phylo.R
index 96d9aa4e590a6f4b9262335d480fc197ea950076..b9309a004882249ce7444517e1eb1bdb1157e63f 100644 (file)
@@ -1,8 +1,8 @@
-## plot.phylo.R (2012-12-19)
+## plot.phylo.R (2013-01-11)
 
 ##   Plot Phylogenies
 
-## Copyright 2002-2012 Emmanuel Paradis
+## Copyright 2002-2013 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -650,12 +650,10 @@ node.height.clado <- function(phy)
 
 plot.multiPhylo <- function(x, layout = 1, ...)
 {
-    if (layout > 1)
-      layout(matrix(1:layout, ceiling(sqrt(layout)), byrow = TRUE))
-    else layout(matrix(1))
-    if (!par("ask")) {
-        par(ask = TRUE)
-        on.exit(par(ask = FALSE))
+    layout(matrix(1:layout, ceiling(sqrt(layout)), byrow = TRUE))
+    if (!devAskNewPage() && interactive()) {
+        devAskNewPage(TRUE)
+        on.exit(devAskNewPage(FALSE))
     }
     for (i in 1:length(x)) plot(x[[i]], ...)
 }
@@ -721,9 +719,9 @@ kronoviz <- function(x, layout = length(x), horiz = TRUE, ...)
         h <- 1
     }
     layout(matrix(1:layout, nrow), widths = w, heights = h)
-    if (layout > Ntree && !par("ask")) {
-        par(ask = TRUE)
-        on.exit(par(ask = FALSE))
+    if (layout < Ntree && !devAskNewPage() && interactive()) {
+        devAskNewPage(TRUE)
+        on.exit(devAskNewPage(FALSE))
     }
     if (horiz) {
         for (i in 1:Ntree)