
This function represents a phylogeny as a fan, using circles to provide a
legend for distances and optionally colored symbols to represent traits
associated to the tips of the tree. This function uses and is compatible
with ape's plot.phylo
.
bullseye(
phy,
traits = NULL,
col.tips.by = NULL,
col.pal = spectral,
circ.n = 6,
circ.bg = transp("royalblue", 0.1),
circ.unit = NULL,
legend = TRUE,
leg.posi = "bottomleft",
leg.title = "",
leg.bg = "white",
traits.inset = 1.1,
traits.space = 0.05,
traits.pch = 19,
traits.cex = 1,
alpha = 1,
axis = TRUE,
...
)
No return value, function produces only a plot.
The phylo4d-class
class for storing phylogeny+data
.
plot.phylo
from the ape
package.
dotchart.phylog
.
a tree in phylo
, phylo4-class
or
phylo4d-class
format.
an optional data.frame of traits.
an optional vector used to define colors for tip labels;
if unamed, must be ordered in the same order as phy$tip.label
.
a function generating colors according to a given palette; several palettes can be provided as a list, in the case of several traits; the first palette is always reserved for the tip colors; this argument is recycled.
the number of circles for the distance annotations.
the color of the circles.
the unit of the circles; if NULL, determined automatically from the data.
a logical specifying whether a legend should be plotted; only one legend is displayed, with priority to tip colors first, and then to the first trait.
position, title and background for the legend.
inset for positioning the traits; 1 corresponds to the circle crossing the furthest tip, 0 to the center of the plot.
a coefficient indicating the spacing between traits.
type and size of the symbols used for the traits; recycled if needed.
alpha value to be used for the color transparency, between 0 (invisible) and 1 (plain).
a logical indicating whether an axis should be displayed.
further arguments to be passed to plot methods from ape
.
See plot.phylo
.
Thibaut Jombart tjombart@imperial.ac.uk
table.phylo4d
for non-radial plots.
if(require(ape) && require(phylobase) && require(adegenet)){
data(lizards)
tre <- read.tree(text=lizards$hprA) # make a tree
## basic plots
bullseye(tre)
bullseye(tre, lizards$traits)
## customized
oldpar <- par(mar=c(6,6,6,6))
bullseye(tre, lizards$traits, traits.cex=sqrt(1:7), alpha=.7,
legend=FALSE, circ.unit=10, circ.bg=transp("black",.1),
edge.width=2)
par(oldpar)
}
Run the code above in your browser using DataLab