[R] R: Colouring phylogenetic tip labels and/or edges

Ben Bolker bbolker at gmail.com
Sat Apr 14 15:54:41 CEST 2012


Monroe, Melanie <melanie.monroe <at> yale.edu> writes:

> I have reconstructed ancestral character states on a phylogeny using
> MuSSE in the diversitree package and plotted the character state
> probabilities as pie charts on the nodes. I would, however, like to
> colour the character states of my extant species, i.e. the tip
> labels, the same colours as my pie charts, such that all species in
> state 1 are e.g. blue, species in state 2 red and species in state 3
> yellow, and have not been successful with my attempts. I am only
> able to colour them in repeating sets of 3e.g. sp1=blue, sp.2=red,
> sp.3=yellow, sp.4=blue, sp5=red, sp6=yellow etc. I am also wondering
> how to colour the branches or edges as the states transition from
> one to another over time (i.e. as in the "Analyzing diversification
> with diversitree" manual by Rich FitzJohn on page 23).

  You probably need to ask this question on the r-sig-phylo
mailing list, which specializes in comparative methods and
phylogenetics.  For the tips you will probably want something like
tip.color=rep(c("blue","red","yellow"),nspecies/3).

  Ben Bolker



More information about the R-help mailing list