Skip to contents

Defines the ggplot theme with the default R colors.

Usage

theme_mediocre(
  pal = "autumn",
  gradient = NULL,
  background = FALSE,
  base_size = if (.Platform$OS.type == "windows") 17 else 14,
  base_family = "Lato",
  base_line_size = base_size/50,
  base_rect_size = base_size/170
)

theme_mediocre_map(
  pal = "autumn",
  gradient = NULL,
  background = FALSE,
  base_size = if (.Platform$OS.type == "windows") 17 else 14,
  base_family = "Lato",
  base_line_size = base_size/50,
  base_rect_size = base_size/170
)

Arguments

pal

a string. Defines the color palette selected. Can either be either "autumn", "rainbow", "green", "hotcold", "blackandwhite", "coty", "leo", "portal" or "pem"

gradient

a string, either "left" or "right". Turns divergent palettes into gradient ones by splitting it in two. If equal to "right", the gradient palette is built with the right hand side part of the divergent palette. If equal to "left", uses the left hand side but flipping so that light values are on the left.

background

If TRUE, a background is added to the plots

base_size

Base font size, given in pts.

base_family

Base font family

base_line_size

Base size for line elements

base_rect_size

Base size for rect elements

Examples

ggplot(ggplot2::mpg, aes(x = cty, y = displ, fill = manufacturer)) +
  geom_col() +
  theme_mediocre() +
  labs(title = "A very nice title", subtitle = "A disappointing subtitle")
#> Warning: The `scale_name` argument of `discrete_scale()` is deprecated as of ggplot2
#> 3.5.0.


ggplot(ggplot2::mpg, aes(x = cty, y = displ, color = hwy)) +
  geom_point() +
  theme_mediocre() +
  labs(title = "A very nice title", subtitle = "A disappointing subtitle")