```{r}
# Make tree
sm_k31_tree <- ggtree(sm_k31_phylo, color = "black", size = 0.3, layout = "fan", open.angle = 6)
# Add gheatmap 1 for biochemical assay 1
pgp1 <- gheatmap(sm_k31_tree, pgp_master[, "BNF", drop=F], width=0.1,
colnames_angle = 90, colnames_offset_x =0.4, font.size = 3,
color = "black") + scale_fill_gradient(high = "blue", low = "pink")
# Add gheatmap 2 for assay 2
pgp2 <- gheatmap(pgp1, pgp_master[, "ACC", drop=F], offset = 0.5, width = 0.1,
colnames_angle = 90, colnames_offset_x = 0.5, font.size = 3,
color = "black", high = "green", low = "red")
# create alternate for legend extract
pgp2x <- gheatmap(sm_k31_tree, pgp_master[, "ACC", drop=F], offset = 0.8, width = 0.1,
colnames_angle = 90, colnames_offset_x = 0.5, font.size = 2,
color = "black", high = "green", low = "red")
# extract legends
require(cowplot)
pgp_leg1 <- get_legend(pgp1)
pgp_leg2 <- get_legend(pgp2x)
# create plot object
pp <- pgp2 + theme(legend.position = "none") + geom_tiplab2(aes(angle=angle), size = 0.8, color = "black", offset = 2)
# plot object with legends
plot_grid(pp, pgp_leg1, pgp_leg2, ncol = 3, rel_widths = c(1, 0.1, 0.1))
```
--
1. 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, 2017, 8(1):28-36. doi:10.1111/2041-210X.12628
2. G Yu*, TTY Lam, H Zhu, Y Guan*. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution, 2018, 35(2):3041-3043. doi: 10.1093/molbev/msy194
3. Book: https://yulab-smu.github.io/treedata-book/
---
You received this message because you are subscribed to the Google Groups "ggtree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree...@googlegroups.com.
To post to this group, send email to bioc-...@googlegroups.com.
Visit this group at https://groups.google.com/group/bioc-ggtree.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/b85ddef6-f01a-4c71-bed0-5740e677c2da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-...@googlegroups.com.
To post to this group, send email to bioc-...@googlegroups.com.
Visit this group at https://groups.google.com/group/bioc-ggtree.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/b85ddef6-f01a-4c71-bed0-5740e677c2da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
In current release of ggtree, the legend title is disable by default. You can use +theme(legend.title=element_text())
to enable it.
In furture version, legend title will be enable by default, and user can use gheatmap(..., legend_title="your title")
to specify the title name, see https://github.com/GuangchuangYu/ggtree/commit/c00aac1c13b98fd115c367063d07ee157cb97691.
--
1. G Yu*, TTY Lam, H Zhu, Y Guan*. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution, 2018, 35(2):3041-3043. doi: 10.1093/molbev/msy194
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, 2017, 8(1):28-36. doi:10.1111/2041-210X.12628
3. Book: https://yulab-smu.github.io/treedata-book/
---
You received this message because you are subscribed to the Google Groups "ggtree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree...@googlegroups.com.
To post to this group, send email to bioc-...@googlegroups.com.
Visit this group at https://groups.google.com/group/bioc-ggtree.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/a0980756-9918-4b56-81e8-17f7f283bef6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.