http://www.phytools.org/eqg/Exercise_3.2/
library('ggplot2')
library('ggtree')
library('treeio')
library('ggrepel')
beast_file <- system.file("examples/star_mcmc_species2.tree", package="ggtree")
beast_tree <- read.beast(beast_file)
genotype_file <- system.file("examples/euploea06.txt", package="ggtree")
genotype <- read.table(genotype_file, sep="\t", stringsAsFactor=F)
colnames(genotype) <- sub("\\.$", "", colnames(genotype))
p <- ggtree(beast_tree, mrsd="2013-01-01") + geom_treescale(x=2008, y=1, offset=2)
p <- p + geom_tiplab(size=2)
gheatmap(p, genotype, offset = 50, width=0.5, font.size=3, colnames_angle=-45, hjust=0)
ggsave('beasttest03.jpg', dpi = 600)
沒有留言:
張貼留言