Plotting phylogenetic trees

Phylo defines recipes for all AbstractTrees, allowing them to be plotted with Plots.jl.

Keywords

It adds these keywords to the ones initially supported by Plots.jl:

  • treetype: choosing :fan or :dendrogram determines the shape of the tree
  • marker_group: applies the group keyword to node markers
  • line_group: applies the group keyword to branch lines
  • showtips: true (the default) shows the leaf names
  • tipfont: a tuple defining the font to use for leaf names (default is (7,)),

which sets the font size to 7 - for font definitions see Plots annotation fonts

Example plots

For this example, we will use the phylogeny of all extant hummingbird species.

Read the tree and plot it using two different treetypes. The default is :dendrogram

using Phylo, Plots
default(linecolor = :black, size = (400, 400)) # looks nicer with black lines
hummers = open(parsenewick, Phylo.path("hummingbirds.tree"))
plot(hummers, size = (400, 600), showtips = false)

For larger trees, the :fan treetype may work better

plot(hummers, treetype = :fan)