ggtree version of plotTree

December 16, 2016

(This article was first published on R on Guangchuang YU, and kindly contributed to R-bloggers)

PLOTTING TREES + DATA is difficult. @DrKatHolt developed plotTree (R and Python scripts) to visualize associated data with trees, e.g. heatmap, horizontal bar etc.

I reproduced the examples presented in the plotTree repo using ggtree. Source code is freely available in

Here are the outputs produced by ggtree:

Tree with basic strain info

Pan genome heatmap

Curated genes, coloured

It can be very easy to produce a circular/fan layout version, and the tree was used to generate the ggtree hex sticker.

General solution with facet_plot

ggtree provide the facet_plot function which can be used to associate different types of data to the tree. With ggtree we can associate more data (can be different types) and combine them freely.

see also examples in 1 and 2.


G Yu, DK Smith, H Zhu, Y Guan, TTY Lam*. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. Methods in Ecology and Evolution. doi:10.1111/2041-210X.12628.

To leave a comment for the author, please follow the link and comment on their blog: R on Guangchuang YU. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)