Browse code

geom_treescale() supports family argument <2016-04-27, Wed>

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

g.yu authored on 27/04/2016 09:37:02
Showing 3 changed files

... ...
@@ -1,5 +1,7 @@
1 1
 CHANGES IN VERSION 1.3.16
2 2
 ------------------------
3
+ o geom_treescale() supports family argument <2016-04-27, Wed>
4
+   + https://github.com/GuangchuangYu/ggtree/issues/56
3 5
  o update fortify.phylo to work with phylo that has missing value of edge length <2016-04-21, Thu>
4 6
    + https://github.com/GuangchuangYu/ggtree/issues/54
5 7
  o support passing textConnection(text_string) as a file <2016-04-21, Thu>
... ...
@@ -9,11 +9,12 @@
9 9
 ##' @param color color
10 10
 ##' @param linesize size of line
11 11
 ##' @param fontsize size of text
12
+##' @param family sans by default, can be any supported font
12 13
 ##' @return ggplot layers
13 14
 ##' @export
14 15
 ##' @author Guangchuang Yu
15 16
 geom_treescale <- function(x=NULL, y=NULL, width=NULL, offset=NULL, color="black",
16
-                           linesize=0.5, fontsize=3.88) {
17
+                           linesize=0.5, fontsize=3.88, family="sans") {
17 18
     
18 19
     data=NULL
19 20
     position="identity"
... ...
@@ -29,7 +30,8 @@ geom_treescale <- function(x=NULL, y=NULL, width=NULL, offset=NULL, color="black
29 30
                            mapping=mapping, data=data,
30 31
                            position=position, show.legend = show.legend,
31 32
                            inherit.aes = inherit.aes, na.rm=na.rm),
32
-        stat_treeScaleText(xx=x, yy=y, width=width, color=color, offset=offset, size=fontsize,
33
+        stat_treeScaleText(xx=x, yy=y, width=width, color=color, offset=offset,
34
+                           size=fontsize, family = family, 
33 35
                            mapping=mapping, data=data,
34 36
                            position=position, show.legend = show.legend,
35 37
                            inherit.aes = inherit.aes, na.rm=na.rm)
... ...
@@ -5,7 +5,7 @@
5 5
 \title{geom_treescale}
6 6
 \usage{
7 7
 geom_treescale(x = NULL, y = NULL, width = NULL, offset = NULL,
8
-  color = "black", linesize = 0.5, fontsize = 3.88)
8
+  color = "black", linesize = 0.5, fontsize = 3.88, family = "sans")
9 9
 }
10 10
 \arguments{
11 11
 \item{x}{x position}
... ...
@@ -21,6 +21,8 @@ geom_treescale(x = NULL, y = NULL, width = NULL, offset = NULL,
21 21
 \item{linesize}{size of line}
22 22
 
23 23
 \item{fontsize}{size of text}
24
+
25
+\item{family}{sans by default, can be any supported font}
24 26
 }
25 27
 \value{
26 28
 ggplot layers