Skip to contents

Give some reach colors and fonts to a ggplot.

Usage

theme_reach(
  initiative = "reach",
  palette = "main",
  discrete = TRUE,
  reverse = FALSE,
  font_family = "Segoe UI",
  title_size = 12,
  title_color = cols_reach("main_grey"),
  title_font_face = "bold",
  title_hjust = NULL,
  title_position_to_plot = TRUE,
  text_size = 10,
  text_color = cols_reach("main_grey"),
  text_font_face = "plain",
  panel_background_color = "#FFFFFF",
  panel_border = FALSE,
  panel_border_color = cols_reach("main_grey"),
  legend_position = "right",
  legend_direction = "vertical",
  legend_reverse = TRUE,
  legend_title_size = 11,
  legend_title_color = cols_reach("main_grey"),
  legend_title_font_face = "plain",
  legend_text_size = 10,
  legend_text_color = cols_reach("main_grey"),
  legend_text_font_face = "plain",
  axis_x = TRUE,
  axis_y = TRUE,
  axis_text_size = 10,
  axis_text_color = cols_reach("main_grey"),
  axis_text_font_face = "plain",
  axis_title_size = 11,
  axis_title_color = cols_reach("main_grey"),
  axis_title_font_face = "bold",
  axis_text_x_angle = 0,
  axis_text_x_vjust = 0.5,
  axis_text_x_hjust = 0.5,
  grid_major_x = FALSE,
  grid_major_y = FALSE,
  grid_major_color = cols_reach("main_lt_grey"),
  grid_major_x_size = 0.1,
  grid_major_y_size = 0.1,
  grid_minor_x = FALSE,
  grid_minor_y = FALSE,
  grid_minor_color = cols_reach("main_lt_grey"),
  grid_minor_x_size = 0.05,
  grid_minor_y_size = 0.05,
  caption_position_to_plot = TRUE,
  ...
)

Arguments

initiative

Either "reach" or "default".

palette

Palette name from 'pal_reach()'.

discrete

Boolean indicating whether color aesthetic is discrete or not.

reverse

Boolean indicating whether the palette should be reversed.

font_family

The font family for all plot's texts. Default to "Segoe UI".

title_size

The size of the legend title. Defaults to 11.

title_color

Legend title color.

title_font_face

Legend title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").

title_hjust

Title horizontal justification. Default to NULL. Use 0.5 to center the title.

title_position_to_plot

TRUE or FALSE. Positioning to plot or to panel?

text_size

The size of all text other than the title, subtitle and caption. Defaults to 10.

text_color

Text color.

text_font_face

Text font face. Default to "bold". Font face ("plain", "italic", "bold", "bold.italic").

panel_background_color

The color for the panel background color. Default to white.

panel_border

Boolean. Plot a panel border? Default to FALSE.

panel_border_color

A color. Default to REACH main grey.

legend_position

Position of the legend; Default to "right". Can take "right", "left", "top", "bottom" or "none".

legend_direction

Direction of the legend. Default to "vertical". Can take "vertical" or "horizontal".

legend_reverse

Reverse the color in the guide? Default to TRUE.

legend_title_size

Legend title size.

legend_title_color

Legend title color.

legend_title_font_face

Legend title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").

legend_text_size

Legend text size.

legend_text_color

Legend text color.

legend_text_font_face

Legend text font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").

axis_x

Boolean. Do you need x-axis?

axis_y

Boolean. Do you need y-axis?

axis_text_size

Axis text size.

axis_text_color

Axis text color.

axis_text_font_face

Axis text font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").

axis_title_size

Axis title size.

axis_title_color

Axis title color.

axis_title_font_face

Axis title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").

axis_text_x_angle

Angle for the x-axis text.

axis_text_x_vjust

Vertical adjustment for the x-axis text.

axis_text_x_hjust

Vertical adjustment for the x-axis text.

grid_major_x

Boolean. Do you need major grid lines for x-axis?

grid_major_y

Boolean. Do you need major grid lines for y-axis?

grid_major_color

Major grid lines color.

grid_major_x_size

Major X line size.

grid_major_y_size

Major Y line size.

grid_minor_x

Boolean. Do you need minor grid lines for x-axis?

grid_minor_y

Boolean. Do you need minor grid lines for y-axis?

grid_minor_color

Minor grid lines color.

grid_minor_x_size

Minor X line size.

grid_minor_y_size

Minor Y line size.

caption_position_to_plot

TRUE or FALSE. Positioning to plot or to panel?

...

Additional arguments passed to `ggplot2::gg_theme()`.

Value

The base REACH theme