Re: [R-sig-phylo] Logarithmic Scales for Plotting Dated Phyogenies (e.g. Log of Time Axis?)
Hi David, Have you tried ape::plotBreakLongEdges? I think that would be the simplest solution to your problem. I'm not clear how a non-linear transformation could be implemented easily (and be meaningful in most situations). Le 02/01/2019 à 21:15, David Bapst a écrit : Hi all, I've been dealing with a tree with one very deep divergence and many very shallow divergences recently, and I was curious if there was an R plotting capability that allows for the depth axis of the tree to be non-linear or logarithmic - helpful if there can be a time axis bar as well, as with axisPhylo(). Logging the axis directly with par seems to break plot.phylo, presumably because its trying to plot something at a negative coordinate. It seems like a simple thing, but oddly I haven't come upon anything yet that can do this. Any thoughts? Cheers, -Dave PS: Tangential to that, is there a ladderize function that also takes into account the edge length on non-ultrametric trees? I just noticed that ladderize doesn't do much for a tree with a large polytomy consisting of branches of very different length. None that I know, but that could be useful indeed. PPS: Happy New Years, all! I just checked and its now been nine years I've been following this listserv... Happy New Years to you and to all! In one month, it will be 11 years that the list started. ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] Logarithmic Scales for Plotting Dated Phyogenies (e.g. Log of Time Axis?)
Hi David, Have you tried ggtree? It is very powerful, as it interfaces nicely with the ggplot2 package functions. I tried to sketch an example, see this link or below signature. https://gist.github.com/kopperud/ae8cca0c29927d1d51fe08fd74cdb90a There are probably better ways of doing this, but it should work. Need a few packages, though? Cheers, Bj�rn Tore Kopperud ``` library(ape) library(ggtree) ## Ggtree is on github, devtools::install_github("GuangchuangYu/ggtree") library(ggplot2) library(gridExtra) ## Random tree set.seed(5) phy <- rtree(15) ## No transformation p1 <- ggtree(phy, ladderize = TRUE) + theme_tree2() + geom_tiplab() + ggtitle("No transform") ## Manipulate the plotting coordinates, square transform p2 <- ggtree(phy, ladderize = TRUE) + theme_tree2() + geom_tiplab() + scale_x_continuous(labels = function(x) sqrt(x), breaks = seq(0, 4)^2) + ## Backtransform the axis labels, and add appropriate breaks ggtitle("Square transform") p2$data$x <- p2$data$x ^2 ## Exponential instead p3 <- ggtree(phy, ladderize = TRUE) + theme_tree2() + geom_tiplab() + scale_x_continuous(labels = function(x) log(x), breaks = exp(seq(0, 4))) + ggtitle("Exponential transform") p3$data$x <- exp(p3$data$x) grid.arrange(p1, p2, p3) ``` From: R-sig-phylo on behalf of David Bapst Sent: 02 January 2019 21:15 To: R Sig Phylo Listserv Subject: [R-sig-phylo] Logarithmic Scales for Plotting Dated Phyogenies (e.g. Log of Time Axis?) Hi all, I've been dealing with a tree with one very deep divergence and many very shallow divergences recently, and I was curious if there was an R plotting capability that allows for the depth axis of the tree to be non-linear or logarithmic - helpful if there can be a time axis bar as well, as with axisPhylo(). Logging the axis directly with par seems to break plot.phylo, presumably because its trying to plot something at a negative coordinate. It seems like a simple thing, but oddly I haven't come upon anything yet that can do this. Any thoughts? Cheers, -Dave PS: Tangential to that, is there a ladderize function that also takes into account the edge length on non-ultrametric trees? I just noticed that ladderize doesn't do much for a tree with a large polytomy consisting of branches of very different length. PPS: Happy New Years, all! I just checked and its now been nine years I've been following this listserv... -- David W. Bapst, PhD Asst Research Professor, Geology & Geophysics, Texas A & M University Postdoc, Ecology & Evolutionary Biology, Univ of Tenn Knoxville https://github.com/dwbapst/paleotree ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
[R-sig-phylo] Logarithmic Scales for Plotting Dated Phyogenies (e.g. Log of Time Axis?)
Hi all, I've been dealing with a tree with one very deep divergence and many very shallow divergences recently, and I was curious if there was an R plotting capability that allows for the depth axis of the tree to be non-linear or logarithmic - helpful if there can be a time axis bar as well, as with axisPhylo(). Logging the axis directly with par seems to break plot.phylo, presumably because its trying to plot something at a negative coordinate. It seems like a simple thing, but oddly I haven't come upon anything yet that can do this. Any thoughts? Cheers, -Dave PS: Tangential to that, is there a ladderize function that also takes into account the edge length on non-ultrametric trees? I just noticed that ladderize doesn't do much for a tree with a large polytomy consisting of branches of very different length. PPS: Happy New Years, all! I just checked and its now been nine years I've been following this listserv... -- David W. Bapst, PhD Asst Research Professor, Geology & Geophysics, Texas A & M University Postdoc, Ecology & Evolutionary Biology, Univ of Tenn Knoxville https://github.com/dwbapst/paleotree ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/