Overrides individual theme settings. By default the overrides apply to theme_ggnext(); pass base to restyle a different preset.

Theme(
  name = character(0),
  background = character(0),
  panel_fill = character(0),
  grid_color = character(0),
  grid_color_minor = character(0),
  axis_color = character(0),
  label_color = character(0),
  title_color = character(0),
  subtitle_color = character(0),
  strip_fill = character(0),
  strip_color = character(0),
  legend_text_color = character(0),
  panel_border = character(0),
  font = character(0),
  title_font = character(0),
  tick_font_size = integer(0),
  title_font_size = integer(0),
  plot_title_size = integer(0),
  plot_subtitle_size = integer(0),
  caption_size = integer(0),
  strip_font_size = integer(0),
  legend_font_size = integer(0),
  title_face = character(0),
  tick_len = integer(0),
  grid_major_x = logical(0),
  grid_major_y = logical(0),
  axis_line_x = logical(0),
  axis_line_y = logical(0),
  ticks_x = logical(0),
  ticks_y = logical(0),
  axis_text_x = logical(0),
  axis_text_y = logical(0),
  axis_title_x = logical(0),
  axis_title_y = logical(0),
  legend_position = character(0),
  point_palette = character(0),
  gradient_low = character(0),
  gradient_high = character(0)
)

theme(..., base = NULL)

Arguments

name

Preset name (informational).

background

Plot background color.

panel_fill

Panel (data area) background color.

grid_color

Major gridline color; "" hides major gridlines.

grid_color_minor

Minor gridline color; "" (default) draws none.

axis_color

Axis line and tick color.

label_color

Tick label and axis title color.

title_color

Plot title color.

subtitle_color

Subtitle and caption color.

strip_fill, strip_color

Facet strip background and text colors.

legend_text_color

Legend label color.

panel_border

Panel border color; "" (default) draws none.

font

CSS font-family stack used for all text.

title_font

Font stack for the plot title; "" inherits font.

tick_font_size

Tick label size (px).

title_font_size

Axis title size (px).

plot_title_size, plot_subtitle_size, caption_size

Title block sizes (px).

strip_font_size

Facet strip label size (px).

legend_font_size

Legend label size (px).

title_face

Plot title weight: "bold" or "normal".

tick_len

Tick mark length (px).

grid_major_x, grid_major_y

Draw major gridlines per axis.

axis_line_x, axis_line_y

Draw the axis lines.

ticks_x, ticks_y

Draw tick marks.

axis_text_x, axis_text_y

Draw tick labels.

axis_title_x, axis_title_y

Draw axis titles.

legend_position

"right", "bottom", or "none".

point_palette

Optional character vector overriding the discrete color palette for this plot.

gradient_low, gradient_high

Optional continuous-gradient endpoints.

...

Named Theme properties to override, e.g. theme(panel_fill = "white", grid_color = "grey85").

base

A Theme to start from; defaults to theme_ggnext().

Value

A Theme to add to a plot with +.

Examples

ggnext(cars, aes(speed, dist)) + geom_point() +
  theme(panel_fill = "#FFF8F0", grid_major_x = FALSE)
#> <ggnext plot>
#>   data:  50 x 2
#>   aes:   x = speed, y = dist
#>   layers: 1 
#>   coord: cartesian
#>   mode:  static

# Restyle a preset rather than the default.
ggnext(cars, aes(speed, dist)) + geom_point() +
  theme(base = theme_dark(), plot_title_size = 22)
#> <ggnext plot>
#>   data:  50 x 2
#>   aes:   x = speed, y = dist
#>   layers: 1 
#>   coord: cartesian
#>   mode:  static