mycophyloplot <- function (x, y, assoc = NULL, use.edge.length = FALSE, space = 0, length.line = 1, gap = 2, type = "phylogram", rotate = FALSE, col = par("fg"), lwd = par("lwd"), lty = par("lty"), show.atip.label = TRUE, show.btip.label = TRUE, font = 3, col.atip.label = 'black', col.btip.label = 'black', ...) { if (is.null(assoc)) { assoc <- matrix(ncol = 2) print("No association matrix specified. Links will be omitted.") } if (rotate == TRUE) { cat("\n Click on a node to rotate (right click to exit)\n\n") repeat { res <- plotCophylo2(x, y, assoc = assoc, use.edge.length = use.edge.length, space = space, length.line = length.line, gap = gap, type = type, return = TRUE, col = col, lwd = lwd, lty = lty, show.tip.label = show.tip.label, font = font) click <- identify(res$c[, 1], res$c[, 2], n = 1) if (click < length(res$a[, 1]) + 1) { if (click > res$N.tip.x) x <- rotate(x, click) } else if (click < length(res$c[, 1]) + 1) { if (click > length(res$a[, 1]) + res$N.tip.y) y <- rotate(y, click - length(res$a[, 1])) } } on.exit(print("done")) } else myplotCophylo2(x, y, assoc = assoc, use.edge.length = use.edge.length, space = space, length.line = length.line, gap = gap, type = type, return = FALSE, col = col, lwd = lwd, lty = lty, show.atip.label = show.atip.label, show.btip.label = show.btip.label, font = font, col.atip.label = col.atip.label, col.btip.label = col.btip.label) }