Discussion:
[R-sig-phylo] plotting geologic time scale on circular tree
Jacob Berv
2018-01-03 18:17:19 UTC
Permalink
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-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www
Liam J. Revell
2018-01-03 18:55:20 UTC
Permalink
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: ***@umb.edu
blog: http://blog.phytools.org
Post by Jacob Berv
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?
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
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
_______________________________________________
R-sig-phylo mailing list - R-sig-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-p
Liam J. Revell
2018-01-03 19:20:39 UTC
Permalink
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: ***@umb.edu
blog: http://blog.phytools.org
[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
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/
blog: http://blog.phytools.org
Post by Jacob Berv
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
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
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at
_______________________________________________
R-sig-phylo mailing list - R-sig-***@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-***@r-project.
roee maor
2018-01-04 11:26:46 UTC
Permalink
This post might be inappropriate. Click to display it.
Loading...