[R-sig-phylo] plotting geologic time scale on circular tree
Hi Jake, Liam and list, I have used function ring() in APE (see help for ape::phydataplot) to do this. It gives you full control over colours, transparency etc., but you'll have to manually specify the inner and outer radii of each 'donut'. >From my experience, block colours override the tree branches (the tree disappears if time scale is plotted subsequently), while plotting the time scale before plotting the tree makes it difficult to get the right proportionality between the time scale and the branch lengths. HTH, Roi [[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/
Re: [R-sig-phylo] plotting geologic time scale on circular tree
Oops. I just realized that will plot the colors in reverse - with the most recent eras in the center. This should be fixed: plotTree(tree) obj<-geo.legend() r<-max(obj$leg[,1])-obj$leg[,2] plotTree(tree,type="fan",fsize=0.6,lwd=1) for(i in 1:nrow(obj$leg)){ color<-paste(strsplit(obj$colors[i],"")[[1]][1:7],collapse="") draw.circle(0,0,radius=r[i],col=color,border="transparent") } par(fg="transparent") plotTree(tree,type="fan",add=TRUE,fsize=0.6,lwd=1) par(fg="black") I will also post to my blog. Liam J. Revell, Associate 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 1/3/2018 10:55 AM, Liam J. Revell wrote: [This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing] If you're comfortable with solid colors, rather than semi-transparent as in geo.legend, you could do something like this: plotTree(tree) obj<-geo.legend() ## this is just to get the colors plotTree(tree,type="fan",lwd=1) for(i in nrow(obj$leg):1){ color<-paste(strsplit(obj$colors[i],"")[[1]][1:7],collapse="") draw.circle(0,0,radius=obj$leg[i,1],col=color,border="transparent") } par(fg="transparent") plotTree(tree,type="fan",add=TRUE,lwd=1) par(fg="black") Otherwise you need to plot 'donuts' rather than circles. Let me figure that one out & get back to you. Liam J. Revell, Associate 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 1/3/2018 10:17 AM, Jacob Berv wrote: Hi all, Does anyone know of a function to plot a geologic time scale as a series of concentric circles on a circularly plotted tree? As far as I can tell there are three available functions that can do this on a regular cladogram: axisGeo (phyloch) geoscale.Phylo (strap) geo.legend (phytools) But none of these works with a circular tree, as far as I can tell. It shouldn’t be too hard to code this manually as a series of concentric circles (going try that now), but I figured I’d ask here in case someone has already done this. Cheers, Jake Berv ___ 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 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 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] plotting geologic time scale on circular tree
If you're comfortable with solid colors, rather than semi-transparent as in geo.legend, you could do something like this: plotTree(tree) obj<-geo.legend() ## this is just to get the colors plotTree(tree,type="fan",lwd=1) for(i in nrow(obj$leg):1){ color<-paste(strsplit(obj$colors[i],"")[[1]][1:7],collapse="") draw.circle(0,0,radius=obj$leg[i,1],col=color,border="transparent") } par(fg="transparent") plotTree(tree,type="fan",add=TRUE,lwd=1) par(fg="black") Otherwise you need to plot 'donuts' rather than circles. Let me figure that one out & get back to you. Liam J. Revell, Associate 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 1/3/2018 10:17 AM, Jacob Berv wrote: Hi all, Does anyone know of a function to plot a geologic time scale as a series of concentric circles on a circularly plotted tree? As far as I can tell there are three available functions that can do this on a regular cladogram: axisGeo (phyloch) geoscale.Phylo (strap) geo.legend (phytools) But none of these works with a circular tree, as far as I can tell. It shouldn’t be too hard to code this manually as a series of concentric circles (going try that now), but I figured I’d ask here in case someone has already done this. Cheers, Jake Berv ___ 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 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] plotting geologic time scale on circular tree
Hi all, Does anyone know of a function to plot a geologic time scale as a series of concentric circles on a circularly plotted tree? As far as I can tell there are three available functions that can do this on a regular cladogram: axisGeo (phyloch) geoscale.Phylo (strap) geo.legend (phytools) But none of these works with a circular tree, as far as I can tell. It shouldn’t be too hard to code this manually as a series of concentric circles (going try that now), but I figured I’d ask here in case someone has already done this. Cheers, Jake Berv ___ 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/