Browse Source

no quid pro quo

tags/0.8.0
boB Rudis 4 years ago
parent
commit
dcf320f0f4
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 2
      DESCRIPTION
  2. 3
      NAMESPACE
  3. 179
      R/tinyhand.R
  4. 1
      R/titillium-web.R
  5. BIN
      inst/fonts/tinyhand/BFTinyHand-Regular.ttf
  6. 2
      man/ArialNarrow.Rd
  7. 10
      man/PublicSans.Rd
  8. 6
      man/RobotoCondensed.Rd
  9. 14
      man/TinyHand.Rd
  10. 10
      man/TitilliumWeb.Rd
  11. 2
      man/flush_ticks.Rd
  12. 1
      man/hrbrthemes.Rd
  13. 23
      man/import_tinyhand.Rd
  14. 33
      man/ipsum.Rd
  15. 31
      man/scale_ft.Rd
  16. 31
      man/scale_ipsum.Rd
  17. 112
      man/scale_x_percent.Rd
  18. 49
      man/theme_ipsum.Rd
  19. 52
      man/theme_ipsum_es.Rd
  20. 50
      man/theme_ipsum_ps.Rd
  21. 53
      man/theme_ipsum_pub.Rd
  22. 144
      man/theme_ipsum_rc.Rd
  23. 53
      man/theme_ipsum_tw.Rd
  24. 84
      man/theme_tinyhand.Rd
  25. 8
      man/update_geom_font_defaults.Rd

2
DESCRIPTION

@ -57,5 +57,5 @@ Imports:
tools,
magrittr,
gdtools
RoxygenNote: 6.1.1
RoxygenNote: 7.0.0
VignetteBuilder: knitr

3
NAMESPACE

@ -14,6 +14,7 @@ export(font_pub_light)
export(font_pub_thin)
export(font_rc)
export(font_rc_light)
export(font_th)
export(font_tw)
export(font_tw_bold)
export(font_tw_light)
@ -26,6 +27,7 @@ export(import_econ_sans)
export(import_plex_sans)
export(import_public_sans)
export(import_roboto_condensed)
export(import_tinyhand)
export(import_titillium_web)
export(ipsum)
export(ipsum_pal)
@ -49,6 +51,7 @@ export(theme_ipsum_pub)
export(theme_ipsum_rc)
export(theme_ipsum_tw)
export(theme_modern_rc)
export(theme_tinyhand)
export(update_geom_font_defaults)
import(extrafont)
import(ggplot2)

179
R/tinyhand.R

@ -0,0 +1,179 @@
#' @rdname TinyHand
#' @md
#' @title TinyHand Web font name R variable aliases
#' @description `font_th` == "`BF Tiny Hand`"
#' @format length 1 character vector
#' @export
font_th <- "BFTinyHand-Regular"
#' Something you should never use.
#'
#' You should [import_tinyhand]() first and also install the fonts on your
#' system before trying to use this theme.
#'
#' There is an option `hrbrthemes.loadfonts` which -- if set to `TRUE` -- will
#' call `extrafont::loadfonts()` to register non-core fonts with R PDF & PostScript
#' devices. If you are running under Windows, the package calls the same function
#' to register non-core fonts with the Windows graphics device.
#'
#' @md
#' @section Why Titillium Web?:
#' It's free, has tolerable kerning pairs and multiple weights. It's also different
#' than Arial Narrow and the fonts most folks use in ggplot2 charts.
#'
#' @md
#' @param base_family,base_size base font family and size
#' @param plot_title_family,plot_title_face,plot_title_size,plot_title_margin plot tilte family, face, size and margin
#' @param subtitle_family,subtitle_face,subtitle_size plot subtitle family, face and size
#' @param subtitle_margin plot subtitle margin bottom (single numeric value)
#' @param strip_text_family,strip_text_face,strip_text_size facet label font family, face and size
#' @param caption_family,caption_face,caption_size,caption_margin plot caption family, face, size and margin
#' @param axis_title_family,axis_title_face,axis_title_size axis title font family, face and size
#' @param axis_title_just axis title font justificationk one of `[blmcrt]`
#' @param axis_text_size font size of axis text
#' @param plot_margin plot margin (specify with [ggplot2::margin])
#' @param grid_col grid color
#' @param grid panel grid (`TRUE`, `FALSE`, or a combination of `X`, `x`, `Y`, `y`)
#' @param axis_col axis color
#' @param axis add x or y axes? `TRUE`, `FALSE`, "`xy`"
#' @param ticks ticks if `TRUE` add ticks
#' @export
theme_tinyhand <- function(
base_family=font_th, base_size = 10.5,
plot_title_family=font_th,
plot_title_size = 18,
plot_title_face="bold",
plot_title_margin = 10,
subtitle_family=font_th,
subtitle_size = 13,
subtitle_face = "plain",
subtitle_margin = 15,
strip_text_family = base_family,
strip_text_size = 12,
strip_text_face = "plain",
caption_family=font_th,
caption_size = 9,
caption_face = "plain", caption_margin = 10,
axis_text_size = base_size,
axis_title_family = base_family,
axis_title_size = 9,
axis_title_face = "plain",
axis_title_just = "rt",
plot_margin = margin(30, 30, 30, 30),
grid_col = "#cccccc", grid = TRUE,
axis_col = "#cccccc", axis = FALSE, ticks = FALSE) {
ret <- ggplot2::theme_minimal(base_family=base_family, base_size=base_size)
ret <- ret + theme(legend.background=element_blank())
ret <- ret + theme(legend.key=element_blank())
if (inherits(grid, "character") | grid == TRUE) {
ret <- ret + theme(panel.grid=element_line(color=grid_col, size=0.2))
ret <- ret + theme(panel.grid.major=element_line(color=grid_col, size=0.2))
ret <- ret + theme(panel.grid.minor=element_line(color=grid_col, size=0.15))
if (inherits(grid, "character")) {
if (regexpr("X", grid)[1] < 0) ret <- ret + theme(panel.grid.major.x=element_blank())
if (regexpr("Y", grid)[1] < 0) ret <- ret + theme(panel.grid.major.y=element_blank())
if (regexpr("x", grid)[1] < 0) ret <- ret + theme(panel.grid.minor.x=element_blank())
if (regexpr("y", grid)[1] < 0) ret <- ret + theme(panel.grid.minor.y=element_blank())
}
} else {
ret <- ret + theme(panel.grid=element_blank())
}
if (inherits(axis, "character") | axis == TRUE) {
ret <- ret + theme(axis.line=element_line(color=axis_col, size=0.15))
if (inherits(axis, "character")) {
axis <- tolower(axis)
if (regexpr("x", axis)[1] < 0) {
ret <- ret + theme(axis.line.x=element_blank())
} else {
ret <- ret + theme(axis.line.x=element_line(color=axis_col, size=0.15))
}
if (regexpr("y", axis)[1] < 0) {
ret <- ret + theme(axis.line.y=element_blank())
} else {
ret <- ret + theme(axis.line.y=element_line(color=axis_col, size=0.15))
}
} else {
ret <- ret + theme(axis.line.x=element_line(color=axis_col, size=0.15))
ret <- ret + theme(axis.line.y=element_line(color=axis_col, size=0.15))
}
} else {
ret <- ret + theme(axis.line=element_blank())
}
if (!ticks) {
ret <- ret + theme(axis.ticks = element_blank())
ret <- ret + theme(axis.ticks.x = element_blank())
ret <- ret + theme(axis.ticks.y = element_blank())
} else {
ret <- ret + theme(axis.ticks = element_line(size=0.15))
ret <- ret + theme(axis.ticks.x = element_line(size=0.15))
ret <- ret + theme(axis.ticks.y = element_line(size=0.15))
ret <- ret + theme(axis.ticks.length = grid::unit(5, "pt"))
}
xj <- switch(tolower(substr(axis_title_just, 1, 1)), b=0, l=0, m=0.5, c=0.5, r=1, t=1)
yj <- switch(tolower(substr(axis_title_just, 2, 2)), b=0, l=0, m=0.5, c=0.5, r=1, t=1)
ret <- ret + theme(axis.text.x=element_text(size=axis_text_size, margin=margin(t=0)))
ret <- ret + theme(axis.text.y=element_text(size=axis_text_size, margin=margin(r=0)))
ret <- ret + theme(axis.title=element_text(size=axis_title_size, family=axis_title_family))
ret <- ret + theme(axis.title.x=element_text(hjust=xj, size=axis_title_size,
family=axis_title_family, face=axis_title_face))
ret <- ret + theme(axis.title.y=element_text(hjust=yj, size=axis_title_size,
family=axis_title_family, face=axis_title_face))
ret <- ret + theme(axis.title.y.right=element_text(hjust=yj, size=axis_title_size, angle=90,
family=axis_title_family, face=axis_title_face))
ret <- ret + theme(strip.text=element_text(hjust=0, size=strip_text_size,
face=strip_text_face, family=strip_text_family))
ret <- ret + theme(panel.spacing=grid::unit(2, "lines"))
ret <- ret + theme(plot.title=element_text(hjust=0, size=plot_title_size,
margin=margin(b=plot_title_margin),
family=plot_title_family, face=plot_title_face))
ret <- ret + theme(plot.subtitle=element_text(hjust=0, size=subtitle_size,
margin=margin(b=subtitle_margin),
family=subtitle_family, face=subtitle_face))
ret <- ret + theme(plot.caption=element_text(hjust=1, size=caption_size,
margin=margin(t=caption_margin),
family=caption_family, face=caption_face))
ret <- ret + theme(plot.margin=plot_margin)
ret
}
#' Import Titillium Web font for use in charts
#'
#' Titillium Web is a trademark of Google.
#'
#' There is an option `hrbrthemes.loadfonts` which -- if set to `TRUE` -- will
#' call `extrafont::loadfonts()` to register non-core fonts with R PDF & PostScript
#' devices. If you are running under Windows, the package calls the same function
#' to register non-core fonts with the Windows graphics device.
#'
#' @md
#' @note This will take care of ensuring PDF/PostScript usage. The location of the
#' font directory is displayed after the base import is complete. It is highly
#' recommended that you install them on your system the same way you would any
#' other font you wish to use in other programs.
#' @export
import_tinyhand <- function() {
th_font_dir <- system.file("fonts", "tinyhand", package="hrbrthemes")
suppressWarnings(suppressMessages(extrafont::font_import(th_font_dir, prompt=FALSE)))
message(
sprintf(
"You will likely need to install these fonts on your system as well.\n\nYou can find them in [%s]",
th_font_dir)
)
}

1
R/titillium-web.R

@ -221,4 +221,3 @@ font_tw_bold <- "Titillium Web Bold"
#' @description `font_tw_light` == "`Titillium Web Light`"
#' @export
font_tw_light <- "Titillium Web Light"

BIN
inst/fonts/tinyhand/BFTinyHand-Regular.ttf

Binary file not shown.

2
man/ArialNarrow.Rd

@ -9,6 +9,6 @@
font_an
}
\description{
\code{font_an} == "\code{Arial Narrow}"
\code{font_an} == "\verb{Arial Narrow}"
}
\keyword{datasets}

10
man/PublicSans.Rd

@ -18,16 +18,16 @@ font_pub_light
font_pub_thin
}
\description{
\code{font_pub} == "\code{Public Sans}"
\code{font_pub} == "\verb{Public Sans}"
\code{font_pub_bold} == "\code{Public Sans Bold}"
\code{font_pub_bold} == "\verb{Public Sans Bold}"
\code{font_pub_light} == "\code{Public Sans Light}"
\code{font_pub_light} == "\verb{Public Sans Light}"
\code{font_pub_thin} == "\code{Public Sans Thin}"
\code{font_pub_thin} == "\verb{Public Sans Thin}"
}
\note{
\code{font_pub_bold} (a.k.a. "\code{Public Sans Bold}") is not available on
\code{font_pub_bold} (a.k.a. "\verb{Public Sans Bold}") is not available on
Windows and will throw a warning if used in plots.
}
\keyword{datasets}

6
man/RobotoCondensed.Rd

@ -12,12 +12,12 @@ font_rc
font_rc_light
}
\description{
\code{font_rc} == "\code{Roboto Condensed}"
\code{font_rc} == "\verb{Roboto Condensed}"
\code{font_fc_light} == "\code{Roboto Condensed Light}"
\code{font_fc_light} == "\verb{Roboto Condensed Light}"
}
\note{
\code{font_rc_light} (a.k.a. "\code{Roboto Condensed Light}") is not available on
\code{font_rc_light} (a.k.a. "\verb{Roboto Condensed Light}") is not available on
Windows and will throw a warning if used in plots.
}
\keyword{datasets}

14
man/TinyHand.Rd

@ -0,0 +1,14 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tinyhand.R
\docType{data}
\name{font_th}
\alias{font_th}
\title{TinyHand Web font name R variable aliases}
\format{length 1 character vector}
\usage{
font_th
}
\description{
\code{font_th} == "\verb{BF Tiny Hand}"
}
\keyword{datasets}

10
man/TitilliumWeb.Rd

@ -15,17 +15,17 @@ font_tw_bold
font_tw_light
}
\description{
\code{font_tw} == "\code{Titillium Web}"
\code{font_tw} == "\verb{Titillium Web}"
\code{font_tw_light} == "\code{Titillium Web Bold}"
\code{font_tw_light} == "\verb{Titillium Web Bold}"
\code{font_tw_light} == "\code{Titillium Web Light}"
\code{font_tw_light} == "\verb{Titillium Web Light}"
}
\note{
\code{font_tw_light} (a.k.a. "\code{Titillium Web Bold}") is not available on
\code{font_tw_light} (a.k.a. "\verb{Titillium Web Bold}") is not available on
Windows and will throw a warning if used in plots.
\code{font_tw_light} (a.k.a. "\code{Titillium Web Light}") is not available on
\code{font_tw_light} (a.k.a. "\verb{Titillium Web Light}") is not available on
Windows and will throw a warning if used in plots.
}
\keyword{datasets}

2
man/flush_ticks.Rd

@ -22,7 +22,7 @@ ggplot2 object with \code{theme()} elements added
A covenience function intended for basic, fixed-scale plots only (i.e. does not handle
free scales in facets).\cr
\cr
You need to pass in a ggplot2 object to this function. It can't be \code{+}'d in a chain
You need to pass in a ggplot2 object to this function. It can't be \verb{+}'d in a chain
of geoms, coords, scales, themes, etc. It also builds the plot (but does not display
it) so if the plt takes a while (i.e. has lots of data or transforms) this will also
take a while.

1
man/hrbrthemes.Rd

@ -3,7 +3,6 @@
\docType{package}
\name{hrbrthemes}
\alias{hrbrthemes}
\alias{hrbrthemes-package}
\title{Additional Themes and Theme Components for 'ggplot2'}
\description{
A compilation of extra themes and theme components for 'ggplot2' with an

23
man/import_tinyhand.Rd

@ -0,0 +1,23 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tinyhand.R
\name{import_tinyhand}
\alias{import_tinyhand}
\title{Import Titillium Web font for use in charts}
\usage{
import_tinyhand()
}
\description{
Titillium Web is a trademark of Google.
}
\details{
There is an option \code{hrbrthemes.loadfonts} which -- if set to \code{TRUE} -- will
call \code{extrafont::loadfonts()} to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
}
\note{
This will take care of ensuring PDF/PostScript usage. The location of the
font directory is displayed after the base import is complete. It is highly
recommended that you install them on your system the same way you would any
other font you wish to use in other programs.
}

33
man/ipsum.Rd

@ -4,13 +4,28 @@
\alias{ipsum}
\title{ipsum R markdown template}
\usage{
ipsum(number_sections = FALSE, fig_width = 7, fig_height = 5,
fig_retina = if (!fig_caption) 2, fig_caption = FALSE, dev = "png",
smart = TRUE, self_contained = TRUE, highlight = "default",
mathjax = "default", extra_dependencies = NULL, css = NULL,
includes = NULL, keep_md = FALSE, lib_dir = NULL,
md_extensions = NULL, pandoc_args = NULL, toc = FALSE,
toc_depth = 2, ...)
ipsum(
number_sections = FALSE,
fig_width = 7,
fig_height = 5,
fig_retina = if (!fig_caption) 2,
fig_caption = FALSE,
dev = "png",
smart = TRUE,
self_contained = TRUE,
highlight = "default",
mathjax = "default",
extra_dependencies = NULL,
css = NULL,
includes = NULL,
keep_md = FALSE,
lib_dir = NULL,
md_extensions = NULL,
pandoc_args = NULL,
toc = FALSE,
toc_depth = 2,
...
)
}
\arguments{
\item{number_sections}{\code{TRUE} to number section headings}
@ -54,7 +69,7 @@ base R Markdown HTML output formatter}
\item{css}{One or more css files to include}
\item{includes}{Named list of additional content to include within the
document (typically created using the \code{\link{includes}} function).}
document (typically created using the \code{\link[rmarkdown]{includes}} function).}
\item{keep_md}{Keep the markdown file generated by knitting.}
@ -63,7 +78,7 @@ bootstrap, etc.) into. By default this will be the name of the document with
\code{_files} appended to it.}
\item{md_extensions}{Markdown extensions to be added or removed from the
default definition or R Markdown. See the \code{\link{rmarkdown_format}} for
default definition or R Markdown. See the \code{\link[rmarkdown]{rmarkdown_format}} for
additional details.}
\item{pandoc_args}{Additional command line options to pass to pandoc}

31
man/scale_ft.Rd

@ -13,18 +13,19 @@ scale_color_ft(...)
scale_fill_ft(...)
}
\arguments{
\item{...}{Arguments passed on to \code{ggplot2::discrete_scale}
\describe{
\item{aesthetics}{The names of the aesthetics that this scale works with}
\item{scale_name}{The name of the scale}
\item{palette}{A palette function that when called with a single integer
\item{...}{
Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}}
\describe{
\item{\code{aesthetics}}{The names of the aesthetics that this scale works with}
\item{\code{scale_name}}{The name of the scale}
\item{\code{palette}}{A palette function that when called with a single integer
argument (the number of levels in the scale) returns the values that
they should take.}
\item{name}{The name of the scale. Used as the axis or legend title. If
\item{\code{name}}{The name of the scale. Used as the axis or legend title. If
\code{waiver()}, the default, the name of the scale is taken from the first
mapping used for that aesthetic. If \code{NULL}, the legend title will be
omitted.}
\item{breaks}{One of:
\item{\code{breaks}}{One of:
\itemize{
\item \code{NULL} for no breaks
\item \code{waiver()} for the default breaks computed by the
@ -33,7 +34,7 @@ transformation object
\item A function that takes the limits as input and returns breaks
as output
}}
\item{labels}{One of:
\item{\code{labels}}{One of:
\itemize{
\item \code{NULL} for no labels
\item \code{waiver()} for the default labels computed by the
@ -42,21 +43,21 @@ transformation object
\item A function that takes the breaks as input and returns labels
as output
}}
\item{limits}{A character vector that defines possible values of the scale
\item{\code{limits}}{A character vector that defines possible values of the scale
and their order.}
\item{na.translate}{Unlike continuous scales, discrete scales can easily show
\item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show
missing values, and do so by default. If you want to remove missing values
from a discrete scale, specify \code{na.translate = FALSE}.}
\item{na.value}{If \code{na.translate = TRUE}, what value aesthetic
\item{\code{na.value}}{If \code{na.translate = TRUE}, what value aesthetic
value should missing be displayed as? Does not apply to position scales
where \code{NA} is always placed at the far right.}
\item{drop}{Should unused factor levels be omitted from the scale?
\item{\code{drop}}{Should unused factor levels be omitted from the scale?
The default, \code{TRUE}, uses the levels that appear in the data;
\code{FALSE} uses all the levels in the factor.}
\item{guide}{A function used to create a guide or its name. See
\item{\code{guide}}{A function used to create a guide or its name. See
\code{\link[=guides]{guides()}} for more info.}
\item{super}{The super class to use for the constructed scale}
}}
\item{\code{super}}{The super class to use for the constructed scale}
}}
}
\description{
See \url{ft_pal}.

31
man/scale_ipsum.Rd

@ -13,18 +13,19 @@ scale_color_ipsum(...)
scale_fill_ipsum(...)
}
\arguments{
\item{...}{Arguments passed on to \code{ggplot2::discrete_scale}
\describe{
\item{aesthetics}{The names of the aesthetics that this scale works with}
\item{scale_name}{The name of the scale}
\item{palette}{A palette function that when called with a single integer
\item{...}{
Arguments passed on to \code{\link[ggplot2:discrete_scale]{ggplot2::discrete_scale}}
\describe{
\item{\code{aesthetics}}{The names of the aesthetics that this scale works with}
\item{\code{scale_name}}{The name of the scale}
\item{\code{palette}}{A palette function that when called with a single integer
argument (the number of levels in the scale) returns the values that
they should take.}
\item{name}{The name of the scale. Used as the axis or legend title. If
\item{\code{name}}{The name of the scale. Used as the axis or legend title. If
\code{waiver()}, the default, the name of the scale is taken from the first
mapping used for that aesthetic. If \code{NULL}, the legend title will be
omitted.}
\item{breaks}{One of:
\item{\code{breaks}}{One of:
\itemize{
\item \code{NULL} for no breaks
\item \code{waiver()} for the default breaks computed by the
@ -33,7 +34,7 @@ transformation object
\item A function that takes the limits as input and returns breaks
as output
}}
\item{labels}{One of:
\item{\code{labels}}{One of:
\itemize{
\item \code{NULL} for no labels
\item \code{waiver()} for the default labels computed by the
@ -42,21 +43,21 @@ transformation object
\item A function that takes the breaks as input and returns labels
as output
}}
\item{limits}{A character vector that defines possible values of the scale
\item{\code{limits}}{A character vector that defines possible values of the scale
and their order.}
\item{na.translate}{Unlike continuous scales, discrete scales can easily show
\item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show
missing values, and do so by default. If you want to remove missing values
from a discrete scale, specify \code{na.translate = FALSE}.}
\item{na.value}{If \code{na.translate = TRUE}, what value aesthetic
\item{\code{na.value}}{If \code{na.translate = TRUE}, what value aesthetic
value should missing be displayed as? Does not apply to position scales
where \code{NA} is always placed at the far right.}
\item{drop}{Should unused factor levels be omitted from the scale?
\item{\code{drop}}{Should unused factor levels be omitted from the scale?
The default, \code{TRUE}, uses the levels that appear in the data;
\code{FALSE} uses all the levels in the factor.}
\item{guide}{A function used to create a guide or its name. See
\item{\code{guide}}{A function used to create a guide or its name. See
\code{\link[=guides]{guides()}} for more info.}
\item{super}{The super class to use for the constructed scale}
}}
\item{\code{super}}{The super class to use for the constructed scale}
}}
}
\description{
See \url{ipsum_pal}.

112
man/scale_x_percent.Rd

@ -7,33 +7,93 @@
\alias{scale_y_comma}
\title{X & Y scales with opinionated pre-sets for percent & comma label formats}
\usage{
scale_x_percent(name = waiver(), breaks = waiver(),
minor_breaks = waiver(), limits = NULL, expand = c(0.01, 0),
oob = censor, na.value = NA_real_, trans = "identity",
position = "bottom", sec.axis = waiver(), labels, accuracy = 1,
scale = 100, prefix = "", suffix = "\%", big.mark = " ",
decimal.mark = ".", trim = TRUE, ...)
scale_x_percent(
name = waiver(),
breaks = waiver(),
minor_breaks = waiver(),
limits = NULL,
expand = c(0.01, 0),
oob = censor,
na.value = NA_real_,
trans = "identity",
position = "bottom",
sec.axis = waiver(),
labels,
accuracy = 1,
scale = 100,
prefix = "",
suffix = "\%",
big.mark = " ",
decimal.mark = ".",
trim = TRUE,
...
)
scale_y_percent(name = waiver(), breaks = waiver(),
minor_breaks = waiver(), limits = NULL, expand = c(0.01, 0),
oob = censor, na.value = NA_real_, trans = "identity",
position = "left", sec.axis = waiver(), labels, accuracy = 1,
scale = 100, prefix = "", suffix = "\%", big.mark = " ",
decimal.mark = ".", trim = TRUE, ...)
scale_y_percent(
name = waiver(),
breaks = waiver(),
minor_breaks = waiver(),
limits = NULL,
expand = c(0.01, 0),
oob = censor,
na.value = NA_real_,
trans = "identity",
position = "left",
sec.axis = waiver(),
labels,
accuracy = 1,
scale = 100,
prefix = "",
suffix = "\%",
big.mark = " ",
decimal.mark = ".",
trim = TRUE,
...
)
scale_x_comma(name = waiver(), breaks = waiver(),
minor_breaks = waiver(), limits = NULL, expand = c(0.01, 0),
oob = censor, na.value = NA_real_, trans = "identity",
position = "bottom", sec.axis = waiver(), labels, accuracy = 1,
scale = 1, prefix = "", suffix = "", big.mark = ",",
decimal.mark = ".", trim = TRUE, ...)
scale_x_comma(
name = waiver(),
breaks = waiver(),
minor_breaks = waiver(),
limits = NULL,
expand = c(0.01, 0),
oob = censor,
na.value = NA_real_,
trans = "identity",
position = "bottom",
sec.axis = waiver(),
labels,
accuracy = 1,
scale = 1,
prefix = "",
suffix = "",
big.mark = ",",
decimal.mark = ".",
trim = TRUE,
...
)
scale_y_comma(name = waiver(), breaks = waiver(),
minor_breaks = waiver(), limits = NULL, expand = c(0.01, 0),
oob = censor, na.value = NA_real_, trans = "identity",
position = "left", sec.axis = waiver(), labels, accuracy = 1,
scale = 1, prefix = "", suffix = "", big.mark = ",",
decimal.mark = ".", trim = TRUE, ...)
scale_y_comma(
name = waiver(),
breaks = waiver(),
minor_breaks = waiver(),
limits = NULL,
expand = c(0.01, 0),
oob = censor,
na.value = NA_real_,
trans = "identity",
position = "left",
sec.axis = waiver(),
labels,
accuracy = 1,
scale = 1,
prefix = "",
suffix = "",
big.mark = ",",
decimal.mark = ".",
trim = TRUE,
...
)
}
\arguments{
\item{name}{The name of the scale. Used as axis or legend title. If
@ -91,8 +151,8 @@ want to do that). \code{NULL} means no labels.}
\item{...}{passed on to [scales::comma_format()] or [scales::percent_format()]}
}
\description{
The \code{_comma} ones set comma format for axis text and \code{expand=c(0,0)} (you need to set limits).
The \verb{_comma} ones set comma format for axis text and \code{expand=c(0,0)} (you need to set limits).
}
\details{
The \code{_percent} ones set precent format for axis text and \code{expand=c(0,0)} (you need to set limits).
The \verb{_percent} ones set precent format for axis text and \code{expand=c(0,0)} (you need to set limits).
}

49
man/theme_ipsum.Rd

@ -4,19 +4,36 @@
\alias{theme_ipsum}
\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typography}
\usage{
theme_ipsum(base_family = "Arial Narrow", base_size = 11.5,
plot_title_family = base_family, plot_title_size = 18,
plot_title_face = "bold", plot_title_margin = 10,
subtitle_family = base_family, subtitle_size = 12,
subtitle_face = "plain", subtitle_margin = 15,
strip_text_family = base_family, strip_text_size = 12,
strip_text_face = "plain", caption_family = base_family,
caption_size = 9, caption_face = "italic", caption_margin = 10,
axis_text_size = base_size, axis_title_family = subtitle_family,
axis_title_size = 9, axis_title_face = "plain",
axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30),
grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc",
axis = FALSE, ticks = FALSE)
theme_ipsum(
base_family = "Arial Narrow",
base_size = 11.5,
plot_title_family = base_family,
plot_title_size = 18,
plot_title_face = "bold",
plot_title_margin = 10,
subtitle_family = base_family,
subtitle_size = 12,
subtitle_face = "plain",
subtitle_margin = 15,
strip_text_family = base_family,
strip_text_size = 12,
strip_text_face = "plain",
caption_family = base_family,
caption_size = 9,
caption_face = "italic",
caption_margin = 10,
axis_text_size = base_size,
axis_title_family = subtitle_family,
axis_title_size = 9,
axis_title_face = "plain",
axis_title_just = "rt",
plot_margin = margin(30, 30, 30, 30),
grid_col = "#cccccc",
grid = TRUE,
axis_col = "#cccccc",
axis = FALSE,
ticks = FALSE
)
}
\arguments{
\item{base_family, base_size}{base font family and size}
@ -35,11 +52,11 @@ theme_ipsum(base_family = "Arial Narrow", base_size = 11.5,
\item{axis_title_family, axis_title_face, axis_title_size}{axis title font family, face and size}
\item{axis_title_just}{axis title font justification, one of \code{[blmcrt]}}
\item{axis_title_just}{axis title font justification, one of \verb{[blmcrt]}}
\item{plot_margin}{plot margin (specify with \code{\link[ggplot2:margin]{ggplot2::margin()}})}
\item{grid_col, axis_col}{grid & axis colors; both default to \code{#cccccc}}
\item{grid_col, axis_col}{grid & axis colors; both default to \verb{#cccccc}}
\item{grid}{panel grid (\code{TRUE}, \code{FALSE}, or a combination of \code{X}, \code{x}, \code{Y}, \code{y})}
@ -96,7 +113,7 @@ ggplot(mtcars, aes(mpg, wt)) +
update_geom_font_defaults()
count(mpg, class) \%>\%
count(mpg, class) %>%
ggplot(aes(class, n)) +
geom_col() +
geom_text(aes(label=n), nudge_y=3) +

52
man/theme_ipsum_es.Rd

@ -4,21 +4,39 @@
\alias{theme_ipsum_es}
\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typoghraphy}
\usage{
theme_ipsum_es(base_family = "EconSansCndReg", base_size = 11.5,
plot_title_family = "EconSansCndBol", plot_title_size = 18,
plot_title_face = "bold", plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows") "EconSansCndLig"
else "EconSansCndLig", subtitle_size = 13, subtitle_face = "plain",
subtitle_margin = 15, strip_text_family = base_family,
strip_text_size = 12, strip_text_face = "plain",
caption_family = if (.Platform$OS.type == "windows") "EconSansCndLig"
else "EconSansCndLig", caption_size = 9, caption_face = "plain",
caption_margin = 10, axis_text_size = base_size,
axis_title_family = base_family, axis_title_size = 9,
axis_title_face = "plain", axis_title_just = "rt",
plot_margin = margin(30, 30, 30, 30), panel_spacing = grid::unit(2,
"lines"), grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc",
axis = FALSE, ticks = FALSE)
theme_ipsum_es(
base_family = "EconSansCndReg",
base_size = 11.5,
plot_title_family = "EconSansCndBol",
plot_title_size = 18,
plot_title_face = "bold",
plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows") "EconSansCndLig" else
"EconSansCndLig",
subtitle_size = 13,
subtitle_face = "plain",
subtitle_margin = 15,
strip_text_family = base_family,
strip_text_size = 12,
strip_text_face = "plain",
caption_family = if (.Platform$OS.type == "windows") "EconSansCndLig" else
"EconSansCndLig",
caption_size = 9,
caption_face = "plain",
caption_margin = 10,
axis_text_size = base_size,
axis_title_family = base_family,
axis_title_size = 9,
axis_title_face = "plain",
axis_title_just = "rt",
plot_margin = margin(30, 30, 30, 30),
panel_spacing = grid::unit(2, "lines"),
grid_col = "#cccccc",
grid = TRUE,
axis_col = "#cccccc",
axis = FALSE,
ticks = FALSE
)
}
\arguments{
\item{base_family, base_size}{base font family and size}
@ -37,7 +55,7 @@ theme_ipsum_es(base_family = "EconSansCndReg", base_size = 11.5,
\item{axis_title_family, axis_title_face, axis_title_size}{axis title font family, face and size}
\item{axis_title_just}{axis title font justificationk one of \code{[blmcrt]}}
\item{axis_title_just}{axis title font justificationk one of \verb{[blmcrt]}}
\item{plot_margin}{plot margin (specify with \link[ggplot2:margin]{ggplot2::margin})}
@ -88,7 +106,7 @@ ggplot(mtcars, aes(mpg, wt)) +
# note: may need to make this font_es on Windows
update_geom_font_defaults(family=font_es_light)
count(mpg, class) \%>\%
count(mpg, class) %>%
ggplot(aes(class, n)) +
geom_col() +
geom_text(aes(label=n), nudge_y=3) +

50
man/theme_ipsum_ps.Rd

@ -4,20 +4,38 @@
\alias{theme_ipsum_ps}
\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typoghraphy}
\usage{
theme_ipsum_ps(base_family = "IBMPlexSans", base_size = 11.5,
plot_title_family = "IBMPlexSans-Bold", plot_title_size = 18,
plot_title_face = "plain", plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows") "IBMPlexSans"
else "IBMPlexSans-Light", subtitle_size = 13,
subtitle_face = "plain", subtitle_margin = 15,
strip_text_family = "IBMPlexSans-Medium", strip_text_size = 12,
strip_text_face = "plain", caption_family = if (.Platform$OS.type ==
"windows") "IBMPlexSans" else "IBMPlexSans-Thin", caption_size = 9,
caption_face = "plain", caption_margin = 10, axis_text_size = 9,
axis_title_family = base_family, axis_title_size = 9,
axis_title_face = "plain", axis_title_just = "rt",
plot_margin = margin(30, 30, 30, 30), grid_col = "#cccccc",
grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE)
theme_ipsum_ps(
base_family = "IBMPlexSans",
base_size = 11.5,
plot_title_family = "IBMPlexSans-Bold",
plot_title_size = 18,
plot_title_face = "plain",
plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows") "IBMPlexSans" else
"IBMPlexSans-Light",
subtitle_size = 13,
subtitle_face = "plain",
subtitle_margin = 15,
strip_text_family = "IBMPlexSans-Medium",
strip_text_size = 12,
strip_text_face = "plain",
caption_family = if (.Platform$OS.type == "windows") "IBMPlexSans" else
"IBMPlexSans-Thin",
caption_size = 9,
caption_face = "plain",
caption_margin = 10,
axis_text_size = 9,
axis_title_family = base_family,
axis_title_size = 9,
axis_title_face = "plain",
axis_title_just = "rt",
plot_margin = margin(30, 30, 30, 30),
grid_col = "#cccccc",
grid = TRUE,
axis_col = "#cccccc",
axis = FALSE,
ticks = FALSE
)
}
\arguments{
\item{base_family, base_size}{base font family and size}
@ -36,7 +54,7 @@ theme_ipsum_ps(base_family = "IBMPlexSans", base_size = 11.5,
\item{axis_title_family, axis_title_face, axis_title_size}{axis title font family, face and size}
\item{axis_title_just}{axis title font justificationk one of \code{[blmcrt]}}
\item{axis_title_just}{axis title font justificationk one of \verb{[blmcrt]}}
\item{plot_margin}{plot margin (specify with \link[ggplot2:margin]{ggplot2::margin})}
@ -85,7 +103,7 @@ ggplot(mtcars, aes(mpg, wt)) +
# note: make this font_rc on Windows
update_geom_font_defaults(family=font_rc_light)
count(mpg, class) \%>\%
count(mpg, class) %>%
ggplot(aes(class, n)) +
geom_col() +
geom_text(aes(label=n), nudge_y=3) +

53
man/theme_ipsum_pub.Rd

@ -4,22 +4,39 @@
\alias{theme_ipsum_pub}
\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typoghraphy}
\usage{
theme_ipsum_pub(base_family = "Public Sans", base_size = 10.5,
plot_title_family = if (.Platform$OS.type == "windows") "Public Sans"
else "Public Sans Bold", plot_title_size = 18,
plot_title_face = "bold", plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows")
"Public Sans Thin" else "Public Sans Thin", subtitle_size = 13,
subtitle_face = "plain", subtitle_margin = 15,
strip_text_family = base_family, strip_text_size = 12,
strip_text_face = "plain", caption_family = if (.Platform$OS.type ==
"windows") "Public Sans Thin" else "Public Sans Thin",
caption_size = 9, caption_face = "plain", caption_margin = 10,
axis_text_size = base_size, axis_title_family = base_family,
axis_title_size = 9, axis_title_face = "plain",
axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30),
grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc",
axis = FALSE, ticks = FALSE)
theme_ipsum_pub(
base_family = "Public Sans",
base_size = 10.5,
plot_title_family = if (.Platform$OS.type == "windows") "Public Sans" else
"Public Sans Bold",
plot_title_size = 18,
plot_title_face = "bold",
plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows") "Public Sans Thin" else
"Public Sans Thin",
subtitle_size = 13,
subtitle_face = "plain",
subtitle_margin = 15,
strip_text_family = base_family,
strip_text_size = 12,
strip_text_face = "plain",
caption_family = if (.Platform$OS.type == "windows") "Public Sans Thin" else
"Public Sans Thin",
caption_size = 9,
caption_face = "plain",
caption_margin = 10,
axis_text_size = base_size,
axis_title_family = base_family,
axis_title_size = 9,
axis_title_face = "plain",
axis_title_just = "rt",
plot_margin = margin(30, 30, 30, 30),
grid_col = "#cccccc",
grid = TRUE,
axis_col = "#cccccc",
axis = FALSE,
ticks = FALSE
)
}
\arguments{
\item{base_family, base_size}{base font family and size}
@ -38,7 +55,7 @@ theme_ipsum_pub(base_family = "Public Sans", base_size = 10.5,
\item{axis_title_family, axis_title_face, axis_title_size}{axis title font family, face and size}
\item{axis_title_just}{axis title font justificationk one of \code{[blmcrt]}}
\item{axis_title_just}{axis title font justificationk one of \verb{[blmcrt]}}
\item{plot_margin}{plot margin (specify with \link[ggplot2:margin]{ggplot2::margin})}
@ -86,7 +103,7 @@ ggplot(mtcars, aes(mpg, wt)) +
update_geom_font_defaults(family=font_pub)
count(mpg, class) \%>\%
count(mpg, class) %>%
ggplot(aes(class, n)) +
geom_col() +
geom_text(aes(label=n), nudge_y=3) +

144
man/theme_ipsum_rc.Rd

@ -6,51 +6,101 @@
\alias{theme_ipsum_rc}
\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typoghraphy}
\usage{
theme_ft_rc(base_family = "Roboto Condensed", base_size = 11.5,
plot_title_family = base_family, plot_title_size = 18,
plot_title_face = "bold", plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows")
"Roboto Condensed" else "Roboto Condensed Light", subtitle_size = 13,
subtitle_face = "plain", subtitle_margin = 15,
strip_text_family = base_family, strip_text_size = 12,
strip_text_face = "plain", caption_family = if (.Platform$OS.type ==
"windows") "Roboto Condensed" else "Roboto Condensed Light",
caption_size = 9, caption_face = "plain", caption_margin = 10,
axis_text_size = base_size, axis_title_family = base_family,
axis_title_size = 9, axis_title_face = "plain",
axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30),
grid = TRUE, axis = FALSE, ticks = FALSE)
theme_modern_rc(base_family = "Roboto Condensed", base_size = 11.5,
plot_title_family = base_family, plot_title_size = 18,
plot_title_face = "bold", plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows")
"Roboto Condensed" else "Roboto Condensed Light", subtitle_size = 13,
subtitle_face = "plain", subtitle_margin = 15,
strip_text_family = base_family, strip_text_size = 12,
strip_text_face = "plain", caption_family = if (.Platform$OS.type ==
"windows") "Roboto Condensed" else "Roboto Condensed Light",
caption_size = 9, caption_face = "plain", caption_margin = 10,
axis_text_size = base_size, axis_title_family = base_family,
axis_title_size = 9, axis_title_face = "plain",
axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30),
grid = TRUE, axis = FALSE, ticks = FALSE)
theme_ipsum_rc(base_family = "Roboto Condensed", base_size = 11.5,
plot_title_family = base_family, plot_title_size = 18,
plot_title_face = "bold", plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows")
"Roboto Condensed" else "Roboto Condensed Light", subtitle_size = 13,
subtitle_face = "plain", subtitle_margin = 15,
strip_text_family = base_family, strip_text_size = 12,
strip_text_face = "plain", caption_family = if (.Platform$OS.type ==
"windows") "Roboto Condensed" else "Roboto Condensed Light",
caption_size = 9, caption_face = "plain", caption_margin = 10,
axis_text_size = base_size, axis_title_family = base_family,
axis_title_size = 9, axis_title_face = "plain",
axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30),
panel_spacing = grid::unit(2, "lines"), grid_col = "#cccccc",
grid = TRUE, axis_col = "#cccccc", axis = FALSE, ticks = FALSE)
theme_ft_rc(
base_family = "Roboto Condensed",
base_size = 11.5,
plot_title_family = base_family,
plot_title_size = 18,
plot_title_face = "bold",
plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else
"Roboto Condensed Light",
subtitle_size = 13,
subtitle_face = "plain",
subtitle_margin = 15,
strip_text_family = base_family,
strip_text_size = 12,
strip_text_face = "plain",
caption_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else
"Roboto Condensed Light",
caption_size = 9,
caption_face = "plain",
caption_margin = 10,
axis_text_size = base_size,
axis_title_family = base_family,
axis_title_size = 9,
axis_title_face = "plain",
axis_title_just = "rt",
plot_margin = margin(30, 30, 30, 30),
grid = TRUE,
axis = FALSE,
ticks = FALSE
)
theme_modern_rc(
base_family = "Roboto Condensed",
base_size = 11.5,
plot_title_family = base_family,
plot_title_size = 18,
plot_title_face = "bold",
plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else
"Roboto Condensed Light",
subtitle_size = 13,
subtitle_face = "plain",
subtitle_margin = 15,
strip_text_family = base_family,
strip_text_size = 12,
strip_text_face = "plain",
caption_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else
"Roboto Condensed Light",
caption_size = 9,
caption_face = "plain",
caption_margin = 10,
axis_text_size = base_size,
axis_title_family = base_family,
axis_title_size = 9,
axis_title_face = "plain",
axis_title_just = "rt",
plot_margin = margin(30, 30, 30, 30),
grid = TRUE,
axis = FALSE,
ticks = FALSE
)
theme_ipsum_rc(
base_family = "Roboto Condensed",
base_size = 11.5,
plot_title_family = base_family,
plot_title_size = 18,
plot_title_face = "bold",
plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else
"Roboto Condensed Light",
subtitle_size = 13,
subtitle_face = "plain",
subtitle_margin = 15,
strip_text_family = base_family,
strip_text_size = 12,
strip_text_face = "plain",
caption_family = if (.Platform$OS.type == "windows") "Roboto Condensed" else
"Roboto Condensed Light",
caption_size = 9,
caption_face = "plain",
caption_margin = 10,
axis_text_size = base_size,
axis_title_family = base_family,
axis_title_size = 9,
axis_title_face = "plain",
axis_title_just = "rt",
plot_margin = margin(30, 30, 30, 30),
panel_spacing = grid::unit(2, "lines"),
grid_col = "#cccccc",
grid = TRUE,
axis_col = "#cccccc",
axis = FALSE,
ticks = FALSE
)
}
\arguments{
\item{base_family, base_size}{base font family and size}
@ -69,7 +119,7 @@ theme_ipsum_rc(base_family = "Roboto Condensed", base_size = 11.5,
\item{axis_title_family, axis_title_face, axis_title_size}{axis title font family, face and size}
\item{axis_title_just}{axis title font justificationk one of \code{[blmcrt]}}
\item{axis_title_just}{axis title font justificationk one of \verb{[blmcrt]}}
\item{plot_margin}{plot margin (specify with \link[ggplot2:margin]{ggplot2::margin})}
@ -120,7 +170,7 @@ ggplot(mtcars, aes(mpg, wt)) +
# note: make this font_rc on Windows
update_geom_font_defaults(family=font_rc_light)
count(mpg, class) \%>\%
count(mpg, class) %>%
ggplot(aes(class, n)) +
geom_col() +
geom_text(aes(label=n), nudge_y=3) +

53
man/theme_ipsum_tw.Rd

@ -4,22 +4,39 @@
\alias{theme_ipsum_tw}
\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typoghraphy}
\usage{
theme_ipsum_tw(base_family = "Titillium Web", base_size = 10.5,
plot_title_family = if (.Platform$OS.type == "windows") "Titillium Web"
else "Titillium Web Bold", plot_title_size = 18,
plot_title_face = "bold", plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows") "Titillium Web"
else "Titillium Web Light", subtitle_size = 13,
subtitle_face = "plain", subtitle_margin = 15,
strip_text_family = base_family, strip_text_size = 12,
strip_text_face = "plain", caption_family = if (.Platform$OS.type ==
"windows") "Titillium Web" else "Titillium Web Light",
caption_size = 9, caption_face = "plain", caption_margin = 10,
axis_text_size = base_size, axis_title_family = base_family,
axis_title_size = 9, axis_title_face = "plain",
axis_title_just = "rt", plot_margin = margin(30, 30, 30, 30),
grid_col = "#cccccc", grid = TRUE, axis_col = "#cccccc",
axis = FALSE, ticks = FALSE)
theme_ipsum_tw(
base_family = "Titillium Web",
base_size = 10.5,
plot_title_family = if (.Platform$OS.type == "windows") "Titillium Web" else
"Titillium Web Bold",
plot_title_size = 18,
plot_title_face = "bold",
plot_title_margin = 10,
subtitle_family = if (.Platform$OS.type == "windows") "Titillium Web" else
"Titillium Web Light",
subtitle_size = 13,
subtitle_face = "plain",
subtitle_margin = 15,
strip_text_family = base_family,
strip_text_size = 12,
strip_text_face = "plain",
caption_family = if (.Platform$OS.type == "windows") "Titillium Web" else
"Titillium Web Light",
caption_size = 9,
caption_face = "plain",
caption_margin = 10,
axis_text_size = base_size,
axis_title_family = base_family,
axis_title_size = 9,
axis_title_face = "plain",
axis_title_just = "rt",
plot_margin = margin(30, 30, 30, 30),
grid_col = "#cccccc",
grid = TRUE,
axis_col = "#cccccc",
axis = FALSE,
ticks = FALSE
)
}
\arguments{
\item{base_family, base_size}{base font family and size}
@ -38,7 +55,7 @@ theme_ipsum_tw(base_family = "Titillium Web", base_size = 10.5,
\item{axis_title_family, axis_title_face, axis_title_size}{axis title font family, face and size}
\item{axis_title_just}{axis title font justificationk one of \code{[blmcrt]}}
\item{axis_title_just}{axis title font justificationk one of \verb{[blmcrt]}}
\item{plot_margin}{plot margin (specify with \link[ggplot2:margin]{ggplot2::margin})}
@ -87,7 +104,7 @@ ggplot(mtcars, aes(mpg, wt)) +
# note: make this font_rc on Windows
update_geom_font_defaults(family=font_rc_light)
count(mpg, class) \%>\%
count(mpg, class) %>%
ggplot(aes(class, n)) +
geom_col() +
geom_text(aes(label=n), nudge_y=3) +

84
man/theme_tinyhand.Rd

@ -0,0 +1,84 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tinyhand.R
\name{theme_tinyhand}
\alias{theme_tinyhand}
\title{Something you should never use.}
\usage{
theme_tinyhand(
base_family = font_th,
base_size = 10.5,
plot_title_family = font_th,
plot_title_size = 18,
plot_title_face = "bold",
plot_title_margin = 10,
subtitle_family = font_th,
subtitle_size = 13,
subtitle_face = "plain",
subtitle_margin = 15,
strip_text_family = base_family,
strip_text_size = 12,
strip_text_face = "plain",
caption_family = font_th,
caption_size = 9,
caption_face = "plain",
caption_margin = 10,
axis_text_size = base_size,
axis_title_family = base_family,
axis_title_size = 9,
axis_title_face = "plain",
axis_title_just = "rt",
plot_margin = margin(30, 30, 30, 30),
grid_col = "#cccccc",
grid = TRUE,
axis_col = "#cccccc",
axis = FALSE,
ticks = FALSE
)
}
\arguments{
\item{base_family, base_size}{base font family and size}
\item{plot_title_family, plot_title_face, plot_title_size, plot_title_margin}{plot tilte family, face, size and margin}
\item{subtitle_family, subtitle_face, subtitle_size}{plot subtitle family, face and size}
\item{subtitle_margin}{plot subtitle margin bottom (single numeric value)}
\item{strip_text_family, strip_text_face, strip_text_size}{facet label font family, face and size}
\item{caption_family, caption_face, caption_size, caption_margin}{plot caption family, face, size and margin}
\item{axis_text_size}{font size of axis text}
\item{axis_title_family, axis_title_face, axis_title_size}{axis title font family, face and size}
\item{axis_title_just}{axis title font justificationk one of \verb{[blmcrt]}}
\item{plot_margin}{plot margin (specify with \link[ggplot2:margin]{ggplot2::margin})}
\item{grid_col}{grid color}
\item{grid}{panel grid (\code{TRUE}, \code{FALSE}, or a combination of \code{X}, \code{x}, \code{Y}, \code{y})}
\item{axis_col}{axis color}
\item{axis}{add x or y axes? \code{TRUE}, \code{FALSE}, "\code{xy}"}
\item{ticks}{ticks if \code{TRUE} add ticks}
}
\description{
You should \url{import_tinyhand} first and also install the fonts on your
system before trying to use this theme.
}
\details{
There is an option \code{hrbrthemes.loadfonts} which -- if set to \code{TRUE} -- will
call \code{extrafont::loadfonts()} to register non-core fonts with R PDF & PostScript
devices. If you are running under Windows, the package calls the same function
to register non-core fonts with the Windows graphics device.
}
\section{Why Titillium Web?}{
It's free, has tolerable kerning pairs and multiple weights. It's also different
than Arial Narrow and the fonts most folks use in ggplot2 charts.
}

8
man/update_geom_font_defaults.Rd

@ -4,8 +4,12 @@
\alias{update_geom_font_defaults}
\title{Update matching font defaults for text geoms}
\usage{
update_geom_font_defaults(family = "Arial Narrow", face = "plain",
size = 3.5, color = "#2b2b2b")
update_geom_font_defaults(
family = "Arial Narrow",
face = "plain",
size = 3.5,
color = "#2b2b2b"
)
}
\arguments{
\item{family, face, size, color}{font family name, face, size and color}

Loading…
Cancel
Save