Hi Rafael,

`This is used in example(phydataplot), but once you called plot(tree,`

`plot = FALSE), you cannot change x.lim, y.lim, etc. You can notice in`

`these examples that these parameters are (most of the time) not nicely`

`set: this is because the data are simulated. If you work interactively,`

`it's quite easy to find the appropriate value of x.lim with a few tries`

`for a given data set. Then, once this is saved in a script, it's`

`possible to repeat the plot and adjust the other parameters (colours,`

`legend, ...)`

Best, Emmanuel Le 26/09/2017 à 18:10, Rafael Maia a écrit :

Hi Elizabeth,I ran into a similar problem recently (with another package) and asimple solution that worked for me is to call par(new=TRUE) before yourplot=TRUE plot. So something like:pdf('test.pdf') plot(tree, plot=FALSE) par(new=TRUE) plot(tree, plot=TRUE) dev.off() HTH Best, Rafael Maia — Junior Fellow, Simons Society of Fellows Rubenstein Lab, Columbia University Department of Ecology, Evolution and Environmental Biology New York, NY http://www.rafaelmaia.netOn Sep 26, 2017, at 9:03 AM, Emmanuel Paradis <emmanuel.para...@ird.fr<mailto:emmanuel.para...@ird.fr>> wrote:Hi Elizabeth,You can use directly the functions behind the calculations of thecoordinates; they are documented together: ?node.depth. But this willnot give the final coordinates since more calculations are neededdepending on the widths of the labels, etc.Another possibility could be to plot the tree in a temporary file andget the settings afterwards, eg:R> tmpf <- tempfile() R> pdf(tmpf) R> plot(rtree(100)) R> dev.off() X11cairo 2 R> lastPP <- get("last_plot.phylo", envir = .PlotPhyloEnv) R> lastPP $type [1] "phylogram" .... R> unlink(tmpf) # optional since it's deleted when R is closedJust for the record, if some users wonder about the usefulness of theoption plot=FALSE, see some examples in:example(phydataplot) HTH Best, Emmanuel Le 26/09/2017 à 14:58, Elizabeth Purdom a écrit :Hello,I am writing a function that calls plot.phylo in the ape package withthe option plot=FALSE. I then do some calculations with the output(the calculated coordinates), and then make another call toplot.phylo with plot=TRUE. If I do this, then the plot=FALSE optioncreates a blank plot, which is the result that is clearly documentedin the help pages.However, I do not want this blank plot, because I am saving theresult (the second call to plot.phylo) to a pdf, and so the pdf has ablank page before the plot I want. And since I’m calling this in afunction, I can’t “wait” for the second plot (a similar problemoccurs if you run it in a knitr document)Is there a way to get the output from plot.phylo with all of thecoordinates, etc. without having to have the blank plot? (I do notwant an option to “add” the plot to the blank plot, if it exists,because I am doing these calculations so that in my next call I canchange the x.lim options so the tree only takes up a fraction of theplot, so I need to reset the par, etc., and not just draw on theoriginal coordinates set up by the blank plot)Thank you, Elizabeth PurdomPour nous remonter une erreur de filtrage, veuillez vous rendre ici :http://f.security-mail.net/302lu3ZCAL7_______________________________________________R-sig-phylo mailing list - R-sig-phylo@r-project.org<mailto:R-sig-phylo@r-project.org>https://stat.ethz.ch/mailman/listinfo/r-sig-phyloSearchable archive athttp://www.mail-archive.com/r-sig-phylo@r-project.org/

_______________________________________________ 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/