Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ci-misc
R-utility-belt
Commits
6a09185b
Commit
6a09185b
authored
May 12, 2021
by
Quentin Read
Browse files
stealth theme
parent
8d3792a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
NAMESPACE
View file @
6a09185b
...
...
@@ -4,5 +4,8 @@ export(group_nest_dt)
export(read.csv.better)
export(read_all_csvs)
export(replace_na_dt)
export(theme_black)
export(unnest_dt)
import(data.table)
import(ggplot2)
import(gridExtra)
R/theme_black.R
0 → 100644
View file @
6a09185b
#' ggplot2 stealth black on white theme
#'
#' I believe this was originally created by Jon Lefcheck.
#'
#' @import ggplot2
#' @import gridExtra
#' @export
theme_black
=
function
(
base_size
=
12
,
base_family
=
""
)
{
require
(
ggplot2
)
require
(
gridExtra
)
theme_grey
(
base_size
=
base_size
,
base_family
=
base_family
)
%+replace%
theme
(
# Specify axis options
axis.line
=
element_blank
(),
axis.text.x
=
element_text
(
size
=
base_size
*
0.8
,
color
=
"white"
,
lineheight
=
0.9
),
axis.text.y
=
element_text
(
size
=
base_size
*
0.8
,
color
=
"white"
,
lineheight
=
0.9
),
axis.ticks
=
element_line
(
color
=
"white"
,
size
=
0.2
),
axis.title.x
=
element_text
(
size
=
base_size
,
color
=
"white"
,
margin
=
margin
(
0
,
10
,
0
,
0
)),
axis.title.y
=
element_text
(
size
=
base_size
,
color
=
"white"
,
angle
=
90
,
margin
=
margin
(
0
,
10
,
0
,
0
)),
axis.ticks.length
=
unit
(
0.3
,
"lines"
),
# Specify legend options
legend.background
=
element_rect
(
color
=
NA
,
fill
=
"black"
),
legend.key
=
element_rect
(
color
=
"white"
,
fill
=
"black"
),
legend.key.size
=
unit
(
1.2
,
"lines"
),
legend.key.height
=
NULL
,
legend.key.width
=
NULL
,
legend.text
=
element_text
(
size
=
base_size
*
0.8
,
color
=
"white"
),
legend.title
=
element_text
(
size
=
base_size
*
0.8
,
face
=
"bold"
,
hjust
=
0
,
color
=
"white"
),
legend.position
=
"right"
,
legend.text.align
=
NULL
,
legend.title.align
=
NULL
,
legend.direction
=
"vertical"
,
legend.box
=
NULL
,
# Specify panel options
panel.background
=
element_rect
(
fill
=
"black"
,
color
=
NA
),
panel.border
=
element_rect
(
fill
=
NA
,
color
=
"white"
),
panel.grid.major
=
element_line
(
color
=
"grey35"
),
panel.grid.minor
=
element_line
(
color
=
"grey20"
),
panel.spacing
=
unit
(
0.5
,
"lines"
),
# Specify facetting options
strip.background
=
element_rect
(
fill
=
"grey30"
,
color
=
"grey10"
),
strip.text.x
=
element_text
(
size
=
base_size
*
0.8
,
color
=
"white"
),
strip.text.y
=
element_text
(
size
=
base_size
*
0.8
,
color
=
"white"
,
angle
=
-90
),
# Specify plot options
plot.background
=
element_rect
(
color
=
"black"
,
fill
=
"black"
),
plot.title
=
element_text
(
size
=
base_size
*
1.2
,
color
=
"white"
),
plot.margin
=
unit
(
rep
(
1
,
4
),
"lines"
)
)
}
man/theme_black.Rd
0 → 100644
View file @
6a09185b
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/theme_black.R
\name{theme_black}
\alias{theme_black}
\title{ggplot2 stealth black on white theme}
\usage{
theme_black(base_size = 12, base_family = "")
}
\description{
I believe this was originally created by Jon Lefcheck.
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment