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
... | ... |
@@ -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 |
... | ... |
@@ -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() |