R/graphStyle.R

#' @title graphStyle
#'
#' @description Style for graphs
#'
#' Add to the bottom of GGPlots
#'
#' @export
#' @import ggplot2 extrafont
#'
#' @return Nothing

graphStyle <- function () {
    font <- "Gill Sans MT"

    theme(plot.title = element_text(family = font,
			size = 28, face = "bold", color = "#222222"),
		plot.subtitle = element_text(family = font,
			size = 22, margin = margin(9, 0, 9, 0)),
		plot.caption = element_blank(),

		legend.position = "top",
		legend.text.align = 0,
		legend.background = element_blank(),
            	legend.title = element_blank(),
		legend.key = element_blank(),
            	legend.text = element_text(family = font, size = 18,
			color = "#222222"),

		axis.title = element_blank(),
            	axis.text = element_text(family = font, size = 18,
            		color = "#222222"),
		axis.text.x = element_text(margin = margin(5, b = 10)),
		axis.ticks = element_blank(),
		axis.line = element_blank(),

		panel.grid.minor = element_blank(),
            	panel.grid.major.y = element_line(color = "#cbcbcb"),
            	panel.grid.major.x = element_blank(),
		panel.background = element_blank(),

    strip.background = element_rect(fill = "white"),
    strip.text = element_text(size = 22, hjust = 0))
}
CommoditiesAI/graphHelpers documentation built on Jan. 1, 2022, 12:12 a.m.