R/rotate_labels.R

#' @title Rotate ggplot2 axes labels
#' @description Rotate both axes labels by a given angle.
#' @param angle The angle of rotation.
#' @author Ciaran Tobin
#' @export
rotate_axes_text <- function (angle) 
  theme(axis.text = element_text(angle = angle, hjust = 1L))


#' @title Rotate ggplot2 x-axis labels
#' @description Rotate the x-axis labels/text by a given angle.
#' @inheritParams rotate_axes_text
#' @author Ciaran Tobin
#' @export
rotate_x_text <- function (angle) 
  theme(axis.text.x = element_text(angle = angle, hjust = 1L))


#' @title Rotate ggplot2 x-axis labels
#' @description Rotate the x-axis labels/text by a given angle.
#' @inheritParams rotate_axes_text
#' @author Ciaran Tobin
#' @export
rotate_y_text <- function (angle) 
  theme(axis.text.y = element_text(angle = angle, hjust = 1L))
cttobin/ggthemr documentation built on April 19, 2022, 3:31 a.m.