Skip to content

Commit 7554502

Browse files
committed
Do not overwrite theme_bw and change names
1 parent 5ed3c92 commit 7554502

File tree

5 files changed

+61
-5
lines changed

5 files changed

+61
-5
lines changed

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ export(theme_classic)
390390
export(theme_get)
391391
export(theme_gray)
392392
export(theme_grey)
393+
export(theme_light)
393394
export(theme_line)
395+
export(theme_linedraw)
394396
export(theme_minimal)
395397
export(theme_rect)
396398
export(theme_segment)

R/theme-defaults.r

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,33 @@ theme_grey <- function(base_size = 12, base_family = "") {
6161
theme_gray <- theme_grey
6262

6363

64-
#' A theme with white background and black gridlines.
64+
#' A theme with white background and dark gridlines.
6565
#'
6666
#' @param base_size base font size
6767
#' @param base_family base font family
6868
#' @export
6969
theme_bw <- function(base_size = 12, base_family = "") {
70+
# Starts with theme_grey and then modify some parts
71+
theme_grey(base_size = base_size, base_family = base_family) %+replace%
72+
theme(
73+
axis.text = element_text(size = rel(0.8)),
74+
axis.ticks = element_line(colour = "black"),
75+
legend.key = element_rect(colour = "grey80"),
76+
panel.background = element_rect(fill = "white", colour = NA),
77+
panel.border = element_rect(fill = NA, colour = "grey50"),
78+
panel.grid.major = element_line(colour = "grey90", size = 0.2),
79+
panel.grid.minor = element_line(colour = "grey98", size = 0.5),
80+
strip.background = element_rect(fill = "grey80", colour = "grey50"),
81+
strip.background = element_rect(fill = "grey80", colour = "grey50")
82+
)
83+
}
84+
85+
#' A theme with white background and black gridlines.
86+
#'
87+
#' @param base_size base font size
88+
#' @param base_family base font family
89+
#' @export
90+
theme_linedraw <- function(base_size = 12, base_family = "") {
7091
# Starts with theme_grey and then modify some parts
7192
theme_grey(base_size = base_size, base_family = base_family) %+replace%
7293
theme(
@@ -83,12 +104,12 @@ theme_bw <- function(base_size = 12, base_family = "") {
83104
)
84105
}
85106

86-
#' A theme with white background.
107+
#' A theme with white background and light grey lines
87108
#'
88109
#' @param base_size base font size
89110
#' @param base_family base font family
90111
#' @export
91-
theme_white <- function(base_size = 12, base_family = "") {
112+
theme_light <- function(base_size = 12, base_family = "") {
92113
# Starts with theme_grey and then modify some parts
93114
theme_grey(base_size = base_size, base_family = base_family) %+replace%
94115
theme(
@@ -102,6 +123,7 @@ theme_white <- function(base_size = 12, base_family = "") {
102123
strip.text.x = element_text(colour = "white"),
103124
strip.text.y = element_text(colour = "white", angle = -90)
104125
)
126+
105127
}
106128

107129
#' A minimalistic theme with no background annotations.

man/theme_bw.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Generated by roxygen2 (4.0.0): do not edit by hand
22
\name{theme_bw}
33
\alias{theme_bw}
4-
\title{A theme with white background and black gridlines.}
4+
\title{A theme with white background and dark gridlines.}
55
\usage{
66
theme_bw(base_size = 12, base_family = "")
77
}
@@ -11,6 +11,6 @@ theme_bw(base_size = 12, base_family = "")
1111
\item{base_family}{base font family}
1212
}
1313
\description{
14-
A theme with white background and black gridlines.
14+
A theme with white background and dark gridlines.
1515
}
1616

man/theme_light.Rd

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
% Generated by roxygen2 (4.0.0): do not edit by hand
2+
\name{theme_light}
3+
\alias{theme_light}
4+
\title{A theme with white background and light grey lines}
5+
\usage{
6+
theme_light(base_size = 12, base_family = "")
7+
}
8+
\arguments{
9+
\item{base_size}{base font size}
10+
11+
\item{base_family}{base font family}
12+
}
13+
\description{
14+
A theme with white background and light grey lines
15+
}
16+

man/theme_linedraw.Rd

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
% Generated by roxygen2 (4.0.0): do not edit by hand
2+
\name{theme_linedraw}
3+
\alias{theme_linedraw}
4+
\title{A theme with white background and black gridlines.}
5+
\usage{
6+
theme_linedraw(base_size = 12, base_family = "")
7+
}
8+
\arguments{
9+
\item{base_size}{base font size}
10+
11+
\item{base_family}{base font family}
12+
}
13+
\description{
14+
A theme with white background and black gridlines.
15+
}
16+

0 commit comments

Comments
 (0)