set_mms_ggplot2_theme: Set the custom 'theme' for our plots

Description Usage Arguments Value Examples

View source: R/utils-common.R

Description

set_mms_ggplot2_theme is a wrapper to set a standard custom theme for all of our output plots. It contains only the necessary parameters we require to change in the theme function, and takes the remaining arguments as the default values.

Usage

1
2
3
4
5
6
7
8
9
set_mms_ggplot2_theme(
  ggplot_obj,
  axis_text_size = 17,
  axis_title_size = 17,
  strip_text_x_size = 17,
  legend_text_size = 17,
  legend_title_size = 17,
  legend_position = "bottom"
)

Arguments

ggplot_obj

A ggplot2 object

axis_text_size

A positive integer to define the the size of the x and y axis text in the ggplot2 object.

axis_title_size

A positive integer to define the the size of the x and y axis title text in the ggplot2 object.

strip_text_x_size

A positive integer to define the the size of the facet labels text in the ggplot2 object.

legend_text_size

A positive integer to define the the size of the legend text in the ggplot2 object.

legend_title_size

A positive integer to define the the size of the legend title text in the ggplot2 object.

legend_position

A character value the position of legends ("none", "left", "right", "bottom", "top", or two-element numeric vector)

Value

(ggplot2) : A ggplot2 object with the custom theme applied

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
library(ggplot2)
p1 <- ggplot2::ggplot(mtcars, aes(x = wt, y = mpg, size = disp)) +
    ggplot2::geom_point()

# Set the theme for a ggplot2 object with the default options
out <- p1 %>% maars::set_mms_ggplot2_theme(ggplot_obj = .)

## End(Not run)

shamindras/maar documentation built on Sept. 19, 2021, 10:21 p.m.