git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@117326 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -1,5 +1,6 @@ |
1 | 1 |
CHANGES IN VERSION 1.5.2 |
2 | 2 |
------------------------ |
3 |
+ o add multiplot in ggtreeUtilities vignette <2016-05-12, Thu> |
|
3 | 4 |
o add example of integrate user's data using phylo4d in treeAnnotation vignette <2016-05-11, Wed> |
4 | 5 |
o add extend, extendto parameter in geom_hilight <2016-05-10, Tue> |
5 | 6 |
o geom_hilight now supports hilight tips <2016-05-10, Tue> |
... | ... |
@@ -46,7 +46,7 @@ gheatmap <- function(p, data, offset=0, width=1, low="green", high="red", color= |
46 | 46 |
dd <- data |
47 | 47 |
## dd$lab <- rownames(dd) |
48 | 48 |
lab <- df$label[order(df$y)] |
49 |
- dd <- dd[lab, ] |
|
49 |
+ dd <- dd[lab, , drop=FALSE] |
|
50 | 50 |
dd$y <- sort(df$y) |
51 | 51 |
dd$lab <- lab |
52 | 52 |
## dd <- melt(dd, id=c("lab", "y")) |
... | ... |
@@ -14,7 +14,7 @@ output: |
14 | 14 |
pdf_document: |
15 | 15 |
toc: true |
16 | 16 |
vignette: > |
17 |
- %\VignetteIndexEntry{00 ggtree introduction} |
|
17 |
+ %\VignetteIndexEntry{06 ggtree utilities} |
|
18 | 18 |
%\VignetteEngine{knitr::rmarkdown} |
19 | 19 |
%\usepackage[utf8]{inputenc} |
20 | 20 |
--- |
... | ... |
@@ -49,6 +49,16 @@ beast <- read.beast(file) |
49 | 49 |
ggtree(beast) + geom_point2(aes(subset=!is.na(posterior) & posterior > 0.75), color='firebrick') |
50 | 50 |
``` |
51 | 51 |
|
52 |
+# Multiple graphs on one page |
|
53 |
+ |
|
54 |
+To support viewing multiple plots, ggtree provides `multiplot` function that similar to `gridExtra::grid.arrange` with extra feature of labeling the plots. |
|
55 |
+ |
|
56 |
+ |
|
57 |
+```{r fig.width=8, fig.height=4, warning=FALSE} |
|
58 |
+multiplot(ggtree(rtree(30)), ggtree(rtree(40)), ncol=2, labels=c('A', 'B')) |
|
59 |
+``` |
|
60 |
+ |
|
61 |
+ |
|
52 | 62 |
# subplots in ggplot object |
53 | 63 |
|
54 | 64 |
`ggtree` implemented a function, `subview`, that can add subplots on a ggplot2 object. |