Hi Martin.
Turns out the tip labels in your tree were not being plotted in the
order of tree$tip.label. To fix, I used the following hack:
tree<-read.tree(text=write.tree(tree))
& then the code as before. I have attached the result which seems to be
correct.
Hopefully this resolves the issue.
All the best, Liam
Liam J. Revell, Assistant Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org
On 7/15/2015 8:02 AM, Martin Bulla wrote:
Dear Liam,
Thank you very much for your helpful reply. I can replicate your
example, but with my data, I get the boxplots assigned to the wrong
species. I am sure it is an ordering issue, but I am not sure where it
goes wrong.
Your suggestions would help me please.The script, as well as the data
are here:
M:\PROJECTS\PHD\STATS\boxplot_next_to_tree.r
Best wishes,
Martin
On 14 July 2015 at 16:28, Liam J. Revell <liam.rev...@umb.edu
<mailto:liam.rev...@umb.edu>> wrote:
Hi Martin.
The easiest way to do this is to create two side-by-side plots using
par(mfcol=c(1,2)) and then put your tree & your boxplot in the two
plots; however one has to be very careful in that case to ensure
that the tips align to the correct boxes. I posted a demo of this to
my blog. Let me know if this is helpful.
http://blog.phytools.org/2015/07/plotting-tree-with-adjacent-boxplot.html
All the best, Liam
Liam J. Revell, Assistant Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu <mailto:liam.rev...@umb.edu>
blog: http://blog.phytools.org
On 7/14/2015 6:44 AM, Martin Bulla wrote:
Dear list members,
I wonder whether anyone of you has a code for phyldataplot (or
any other
plotting function) that allows for plotting the distributions of
variable
(e.g., boxplots) next to the phylogeny giving something like:
https://www.dropbox.com/s/2w48qceflgh1knc/boxplot_species_example2.png?dl=0
Your suggestions would help me a lot please.
Best wishes,
Martin
--
Martin Bulla
PhD Student
Department of Behavioural Ecology & Evolutionary Genetics
Max Planck Institute for Ornithology
Eberhard Gwinner Strasse 7
82319 Seewiesen, Germany
Tel: +49 (0) 8157 932 264
Fax: +49 (0) 8157 932 400
www.orn.mpg.de/bulla
<http://www.orn.mpg.de/409970/employee_page?employee_id=26243>
http://orn-mpg.academia.edu/MartinBulla
_______________________________________________
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/