Browse code

fixed theme_tree2

guangchuang yu authored on 05/10/2016 06:28:33
Showing3 changed files

... ...
@@ -25,6 +25,10 @@ install:
25 25
 	R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz
26 26
 
27 27
 check: build
28
+	cd ..;\
29
+	Rscript -e 'rcmdcheck::rcmdcheck("$(PKGNAME)_$(PKGVERS).tar.gz")'
30
+
31
+check2: build
28 32
 	cd ..;\
29 33
 	R CMD check $(PKGNAME)_$(PKGVERS).tar.gz
30 34
 
... ...
@@ -1,6 +1,6 @@
1 1
 ##' tree theme
2 2
 ##'
3
-##' 
3
+##'
4 4
 ##' @title theme_tree
5 5
 ##' @param bgcolor background color
6 6
 ##' @param fgcolor foreground color
... ...
@@ -32,7 +32,7 @@ theme_tree <- function(bgcolor="white", fgcolor="black", ...) {
32 32
 
33 33
 ##' tree2 theme
34 34
 ##'
35
-##' 
35
+##'
36 36
 ##' @title theme_tree2
37 37
 ##' @param bgcolor background color
38 38
 ##' @param fgcolor foreground color
... ...
@@ -57,24 +57,31 @@ theme_tree2 <- function(bgcolor="white", fgcolor="black", ...) {
57 57
 	  )
58 58
 }
59 59
 
60
-theme_tree2_internal <- function(bgcolor="white", fgcolor="black", ...) {
60
+theme_tree2_internal <- function(bgcolor="white", fgcolor="black",
61
+                                 legend.position="none",
62
+                                 panel.grid.minor=element_blank(),
63
+                                 panel.grid.major=element_blank(),
64
+                                 panel.border=element_blank(),
65
+                                 axis.line.y=element_blank(),
66
+                                 axis.ticks.y=element_blank(),
67
+                                 axis.text.y=element_blank(),...) {
61 68
     theme_bw() %+replace%
62
-    theme(legend.position="none",
63
-          panel.grid.minor=element_blank(),
64
-          panel.grid.major=element_blank(),
69
+    theme(legend.position=legend.position,
70
+          panel.grid.minor=panel.grid.minor,
71
+          panel.grid.major=panel.grid.major,
65 72
           panel.background=element_rect(fill=bgcolor, colour=bgcolor),
66
-          panel.border=element_blank(),
73
+          panel.border=panel.border,
67 74
           ## axis.line=element_line(color=fgcolor),
68 75
           axis.line.x=element_line(color=fgcolor),
69
-          axis.line.y=element_blank(),
70
-          axis.ticks.y=element_blank(),
71
-          axis.text.y=element_blank(),
76
+          axis.line.y=axis.line.y,
77
+          axis.ticks.y=axis.ticks.y,
78
+          axis.text.y=axis.text.y,
72 79
           ...)
73 80
 }
74 81
 
75 82
 ##' transparent background theme
76 83
 ##'
77
-##' 
84
+##'
78 85
 ##' @title theme_transparent
79 86
 ##' @param ... additional parameter to tweak the theme
80 87
 ##' @return ggplot object
... ...
@@ -1,9 +1,9 @@
1 1
 ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data
2 2
 ===========================================================================================================================
3 3
 
4
-[![releaseVersion](https://img.shields.io/badge/release%20version-1.4.20-green.svg?style=flat)](https://bioconductor.org/packages/ggtree) [![develVersion](https://img.shields.io/badge/devel%20version-1.5.14-green.svg?style=flat)](https://github.com/GuangchuangYu/ggtree) [![Bioc](http://www.bioconductor.org/shields/years-in-bioc/ggtree.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#since) [![total](https://img.shields.io/badge/downloads-13863/total-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree) [![month](https://img.shields.io/badge/downloads-1122/month-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree)
4
+[![releaseVersion](https://img.shields.io/badge/release%20version-1.4.20-green.svg?style=flat)](https://bioconductor.org/packages/ggtree) [![develVersion](https://img.shields.io/badge/devel%20version-1.5.14-green.svg?style=flat)](https://github.com/GuangchuangYu/ggtree) [![Bioc](http://www.bioconductor.org/shields/years-in-bioc/ggtree.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#since) [![total](https://img.shields.io/badge/downloads-14686/total-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree) [![month](https://img.shields.io/badge/downloads-1678/month-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree)
5 5
 
6
-[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) [![codecov](https://codecov.io/gh/GuangchuangYu/ggtree/branch/master/graph/badge.svg)](https://codecov.io/gh/GuangchuangYu/ggtree) [![Last-changedate](https://img.shields.io/badge/last%20change-2016--09--29-green.svg)](https://github.com/GuangchuangYu/ggtree/commits/master) [![GitHub forks](https://img.shields.io/github/forks/GuangchuangYu/ggtree.svg)](https://github.com/GuangchuangYu/ggtree/network) [![GitHub stars](https://img.shields.io/github/stars/GuangchuangYu/ggtree.svg)](https://github.com/GuangchuangYu/ggtree/stargazers) [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://awesome-r.com/#awesome-r-graphic-displays)
6
+[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) [![codecov](https://codecov.io/gh/GuangchuangYu/ggtree/branch/master/graph/badge.svg)](https://codecov.io/gh/GuangchuangYu/ggtree) [![Last-changedate](https://img.shields.io/badge/last%20change-2016--10--05-green.svg)](https://github.com/GuangchuangYu/ggtree/commits/master) [![GitHub forks](https://img.shields.io/github/forks/GuangchuangYu/ggtree.svg)](https://github.com/GuangchuangYu/ggtree/network) [![GitHub stars](https://img.shields.io/github/stars/GuangchuangYu/ggtree.svg)](https://github.com/GuangchuangYu/ggtree/stargazers) [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://awesome-r.com/#awesome-r-graphic-displays)
7 7
 
8 8
 [![platform](http://www.bioconductor.org/shields/availability/devel/ggtree.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#archives) [![Build Status](http://www.bioconductor.org/shields/build/devel/bioc/ggtree.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/ggtree/) [![Linux/Mac Travis Build Status](https://img.shields.io/travis/GuangchuangYu/ggtree/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/GuangchuangYu/ggtree) [![AppVeyor Build Status](https://img.shields.io/appveyor/ci/Guangchuangyu/ggtree/master.svg?label=Windows)](https://ci.appveyor.com/project/GuangchuangYu/ggtree) [![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-green.svg?style=flat)](http://bioconda.github.io/recipes/bioconductor-ggtree/README.html)
9 9
 
... ...
@@ -17,7 +17,7 @@ Please cite the following article when using `ggtree`:
17 17
 
18 18
 **G Yu**, DK Smith, H Zhu, Y Guan, TTY Lam<sup>\*</sup>. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. ***Methods in Ecology and Evolution***. *accepted*
19 19
 
20
-[![doi](https://img.shields.io/badge/doi-10.1111/2041--210X.12628-green.svg?style=flat)](http://dx.doi.org/10.1111/2041-210X.12628) [![citation](https://img.shields.io/badge/cited%20by-1-green.svg?style=flat)](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=7268358477862164627) [![Altmetric](https://img.shields.io/badge/Altmetric-167-green.svg?style=flat)](https://www.altmetric.com/details/10533079)
20
+[![doi](https://img.shields.io/badge/doi-10.1111/2041--210X.12628-green.svg?style=flat)](http://dx.doi.org/10.1111/2041-210X.12628) [![citation](https://img.shields.io/badge/cited%20by-1-green.svg?style=flat)](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=7268358477862164627) [![Altmetric](https://img.shields.io/badge/Altmetric-168-green.svg?style=flat)](https://www.altmetric.com/details/10533079)
21 21
 
22 22
 ------------------------------------------------------------------------
23 23
 
... ...
@@ -50,30 +50,30 @@ For details, please visit our project website, <https://guangchuangyu.github.io/
50 50
 
51 51
 ### Download stats
52 52
 
53
-[![download](http://www.bioconductor.org/shields/downloads/ggtree.svg)](https://bioconductor.org/packages/stats/bioc/ggtree/) [![total](https://img.shields.io/badge/downloads-13863/total-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree) [![month](https://img.shields.io/badge/downloads-1122/month-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree)
53
+[![download](http://www.bioconductor.org/shields/downloads/ggtree.svg)](https://bioconductor.org/packages/stats/bioc/ggtree/) [![total](https://img.shields.io/badge/downloads-14686/total-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree) [![month](https://img.shields.io/badge/downloads-1678/month-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ggtree)
54 54
 
55
-         +--------------------------+--------------------------+--------------------------+------------+
56
-         |                                                                               *             |
57
-    1200 +                                                                                             +
58
-         |                                                                  *                      *   |
59
-         |                                                                                    *        |
60
-    1000 +                                                                      *    *                 +
55
+         +-------------------------+------------------------+-------------------------+----------------+
56
+         |                                                                                         *   |
61 57
          |                                                                                             |
58
+    1500 +                                                                                             +
62 59
          |                                                                                             |
63 60
          |                                                                                             |
64
-     800 +                                                *        *                                   +
65
-         |                                                             *                               |
66
-         |                                            *        *                                       |
67
-     600 +                                       *                                                     +
68 61
          |                                                                                             |
62
+         |                                                                            *                |
63
+         |                                                               *                    *        |
64
+         |                                                                   *   *        *            |
65
+    1000 +                                                                                             +
69 66
          |                                                                                             |
70
-         |                                   *                                                         |
71
-     400 +                         *    *                                                              +
72
-         |                     *                                                                       |
67
+         |                                              *       *                                      |
68
+         |                                                           *                                 |
69
+         |                                     *    *       *                                          |
73 70
          |                                                                                             |
74
-     200 +                *                                                                            +
71
+     500 +                                 *                                                           +
75 72
          |                                                                                             |
73
+         |                    *   *    *                                                               |
76 74
          |                                                                                             |
77
-         |   *   *    *                                                                                |
78
-       0 +--------------------------+--------------------------+--------------------------+------------+
79
-                                 2015.5                      2016                      2016.5
75
+         |                *                                                                            |
76
+         |                                                                                             |
77
+       0 +   *   *    *                                                                                +
78
+         +-------------------------+------------------------+-------------------------+----------------+
79
+       2015                     2015.5                    2016                     2016.5