Browse code

Commit made by the Bioconductor Git-SVN bridge.

Commit id: 7a2bdd900763fea9cddb45d1a40106d3b2777023

update beast plot method



git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@100748 bc3139a8-67e5-0310-9ffc-ced21a209358

g.yu authored on 17/03/2015 03:22:30
Showing 3 changed files

... ...
@@ -1,7 +1,7 @@
1 1
 Package: ggtree
2 2
 Type: Package
3 3
 Title: a phylogenetic tree viewer for different types of tree annotations
4
-Version: 0.99.25
4
+Version: 0.99.26
5 5
 Author: Guangchuang Yu
6 6
 Maintainer: Guangchuang Yu <guangchuangyu@gmail.com>
7 7
 Description: ggtree extends the ggplot2 plotting system which implemented the
... ...
@@ -1,3 +1,7 @@
1
+CHANGES IN VERSION 0.99.26
2
+------------------------
3
+ o update plot method of beast <2015-03-17, Tue>
4
+ 
1 5
 CHANGES IN VERSION 0.99.25
2 6
 ------------------------
3 7
  o implement groupClade <2015-03-13, Fri>
... ...
@@ -68,9 +68,19 @@ setMethod("plot", signature( x= "beast"),
68 68
                   p <- p + xlim(-offset, max(p$data$x) + offset)
69 69
               }
70 70
               if (!is.null(annotation) && !is.na(annotation)) {
71
+                  if (position == "node") {
72
+                      position <- "x"
73
+                      vjust <- 0
74
+                      hjust <- -.05
75
+                  } else {
76
+                      vjust <- -.5
77
+                      hjust <- 0
78
+                  }
79
+                  
71 80
                   p <- p + geom_text(aes_string(x=position,
72 81
                                                 label=annotation),
73
-                                     size=annotation.size, vjust=-.5,
82
+                                     size=annotation.size,
83
+                                     vjust= vjust, hjust = hjust,
74 84
                                      color=annotation.color)
75 85
               }
76 86
               p + theme_tree2()