theme_rangeframe: Theme modification when using geom_rangeframe

View source: R/wrapper_rangeframe.R

theme_rangeframeR Documentation

Theme modification when using geom_rangeframe

Description

Modifies select aspects of theme_cr() to make it work better with the geom_rangeframe from the ggthemes package.

Usage

theme_rangeframe(
  plot_scale = 1,
  font_scale = 1,
  font = "Roboto Regular",
  symbol = TRUE,
  cairo = FALSE
)

Arguments

plot_scale

Scaling factor for the plot components as a whole. A value of 1 corresponds to a font size of 12 pt and a figure size of 6" by 4"

font_scale

Scaling factor for the font as compared to the plot. A value of 1 will scale the font to the plot size. Larger numbers make the font large compared to the plot size; smaller numbers make the font small compared to the plot size.

font

Font family to be used in the theme, given as a character vector. The font must be included in the theme fonts; use font_names() to see a list of included fonts and font_preview() to preview a selected font.

symbol

Should the theme overwrite the system default Symbol font with the theme default font? If TRUE, theme_cr() will overwrite the Symbol font, and this change will persist until the end of the R session or until clear_registry() is used.

cairo

Is a cairographics device being used to save the figure? ("pdf" and "eps" filetypes) Cairo does not use the font registration from the systemfonts package, so an alternate cairo-safe font must be provided and the normal font registration will be skipped.

Examples

library(ggplot2)
library(ggthemes)

df <- data.frame(x = 1:5, y = 1:5, z = c("a", "b", "c", "b", "c"))
p <- ggplot(df, aes(x, y, color = z)) + geom_point() +
    geom_rangeframe(colour = "gray20")

## Not run: 
p + theme_rangeframe()

## End(Not run)

christyray/crthemes documentation built on April 14, 2023, 11:18 p.m.