Modified ggprism theme which restores the legend title.

theme_ggprism_mod(
  palette = "black_and_white",
  base_size = 14,
  base_family = "sans",
  base_fontface = "bold",
  base_line_size = base_size/20,
  base_rect_size = base_size/20,
  axis_text_angle = 0,
  border = FALSE
)

Arguments

palette

string. Palette name, use names(ggprism_data$themes) to show all valid palette names.

base_size

numeric. Base font size, given in "pt".

base_family

string. Base font family, default is "sans".

base_fontface

string. Base font face, default is "bold".

base_line_size

numeric. Base linewidth for line elements

base_rect_size

numeric. Base linewidth for rect elements

axis_text_angle

integer. Angle of axis text in degrees. One of: 0, 45, 90, 270.

border

logical. Should a border be drawn around the plot? Clipping will occur unless e.g. coord_cartesian(clip = "off") is used.

Value

Returns a list-like object of class theme.

References

theme is a modified version of theme_prism from ggprism package https://github.com/csdaw/ggprism (License: GPL-3). Param text is from ggprism:theme_prism() documentation theme_prism. Theme adaptation based on ggprism vignette https://csdaw.github.io/ggprism/articles/themes.html#make-your-own-ggprism-theme-1.

Examples

# Generate a plot and customize theme
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + theme_ggprism_mod()