Browse code

add example of print tree with specific angle in treeVisualization vignetee

guangchuang yu authored on 27/12/2017 09:01:36
Showing2 changed files

... ...
@@ -224,12 +224,14 @@ the [Tree Annotation](treeAnnotation.html) vignette.
224 224
 + [Tree Manipulation](treeManipulation.html)
225 225
 + [Tree Annotation](treeAnnotation.html)
226 226
 + [Phylomoji](https://cran.r-project.org/web/packages/emojifont/vignettes/phylomoji.html)
227
-+ [Annotating phylogenetic tree with images](https://cran.r-project.org/web/packages/ggimage/vignettes/ggtree.html)
227
++ [Annotating phylogenetic tree with images](https://guangchuangyu.github.io/ggtree/vignettes/ggtree-ggimage.html)
228 228
 
229 229
 
230
-More documents can be found in <https://guangchuangyu.github.io/ggtree>.
230
+**ggtree homepage**: <https://guangchuangyu.github.io/ggtree> (contains more
231
+information about the package, more documentation, a gallery of beautiful
232
+published images and links to related resources).
231 233
 
232
-# Feedback #
234
+# Feedback
233 235
 
234 236
  - For bugs or feature request, please post to [github issue](https://github.com/GuangchuangYu/ggtree/issues).
235 237
  - For user questions, please post to [google group](https://groups.google.com/forum/#!forum/bioc-ggtree).
... ...
@@ -141,15 +141,16 @@ plot_grid(
141 141
 
142 142
 
143 143
 There are also other possible layouts that can be drawed by modifying
144
-scales/coordination, for examples, reverse label of time
145
-scale^[https://github.com/GuangchuangYu/ggtree/issues/87], repropotion
146
-circular/fan tree
147
-^[https://groups.google.com/d/msgid/bioc-ggtree/6db25ec7-ffb1-4776-bfe4-4a1ba239c8e8%40googlegroups.com], *etc.*.
144
+scales/coordination, for examples, [reverse label of time
145
+scale](https://github.com/GuangchuangYu/ggtree/issues/87), [repropotion
146
+circular/fan tree](
147
+https://groups.google.com/d/msgid/bioc-ggtree/6db25ec7-ffb1-4776-bfe4-4a1ba239c8e8%40googlegroups.com), *etc.*.
148 148
 
149 149
 ```{r eval=FALSE}
150 150
 ggtree(tr) + scale_x_reverse()
151 151
 ggtree(tr) + coord_flip()
152 152
 ggtree(tr) + scale_x_reverse() + coord_flip()
153
+print(ggtree(tr), newpage=TRUE, vp = grid::viewport(angle=-30, width=.9, height=.9))
153 154
 ggtree(tr, layout='slanted') + coord_flip()
154 155
 ggtree(tr, layout='slanted', branch.length='none') +
155 156
     coord_flip() + scale_y_reverse() +scale_x_reverse()
... ...
@@ -158,17 +159,22 @@ ggtree(tr) + scale_x_reverse() + coord_polar(theta='y')
158 159
 ggtree(tr) + scale_x_reverse(limits=c(10, 0)) + coord_polar(theta='y')
159 160
 ```
160 161
 
161
-```{r fig.width=8, fig.height = 4, echo=FALSE}
162
+```{r fig.keep='none', echo=FALSE, warning=FALSE}
163
+sv <- grid::grid.grabExpr(print(ggtree(tr), newpage=TRUE, vp = grid::viewport(angle=-30, width=.9, height=.9)))
164
+```
165
+
166
+```{r fig.width=8, fig.height = 8, echo=FALSE, warning=FALSE}
162 167
 plot_grid(
163 168
     ggtree(tr) + scale_x_reverse(),
164 169
     ggtree(tr) + coord_flip(),
165 170
     ggtree(tr) + scale_x_reverse() + coord_flip(),
171
+    sv,
166 172
     ggtree(tr, layout='slanted') + coord_flip(),
167 173
     ggtree(tr, layout='slanted', branch.length='none') + coord_flip() + scale_y_reverse() +scale_x_reverse(),
168 174
     ggtree(tr, layout='circular') + xlim(-10, NA),
169 175
     ggtree(tr) + scale_x_reverse() + coord_polar(theta='y'),
170 176
     ggtree(tr) + scale_x_reverse(limits=c(15, 0)) + coord_polar(theta='y'),
171
-    ncol = 4, labels = LETTERS[1:6])
177
+    ncol = 3, labels = LETTERS[1:9])
172 178
 ```
173 179
 
174 180
 
... ...
@@ -269,7 +275,7 @@ it also supports *image* geom to label tip with image files. A corresponding
269 275
 geom, `geom_nodelab` is also provided for displaying node labels. For details of
270 276
 label nodes with images, please refer to
271 277
 the vignette,
272
-[Annotating phylogenetic tree with images](https://cran.r-project.org/web/packages/ggimage/vignettes/ggtree.html).
278
+[Annotating phylogenetic tree with images](https://guangchuangyu.github.io/ggtree/vignettes/ggtree-ggimage.html).
273 279
 
274 280
 
275 281