Commit id: 4c62d2f58238f5534a0dcd8df6c6a884c0e141be
better geom_tiplab
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ggtree@101639 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -163,12 +163,12 @@ geom_hilight <- function(tree_object, node, ...) { |
163 | 163 |
##' require(ape) |
164 | 164 |
##' tr <- rtree(10) |
165 | 165 |
##' ggtree(tr) + geom_tiplab() |
166 |
-geom_tiplab <- function(align=FALSE, hjust=-.25, ...) { |
|
166 |
+geom_tiplab <- function(align=FALSE, hjust=0, ...) { |
|
167 | 167 |
x <- y <- label <- isTip <- NULL |
168 | 168 |
if (align == TRUE) { |
169 |
- geom_text(aes(x=max(x), label=label), subset=.(isTip), hjust=hjust, ...) |
|
169 |
+ geom_text(aes(x=max(x)+ diff(range(x))/200, label=label), subset=.(isTip), hjust=hjust, ...) |
|
170 | 170 |
} else { |
171 |
- geom_text(aes(label=label), subset=.(isTip), hjust=hjust, ...) |
|
171 |
+ geom_text(aes(x = x + diff(range(x))/200, label=label), subset=.(isTip), hjust=hjust, ...) |
|
172 | 172 |
} |
173 | 173 |
} |
174 | 174 |
|