R/urbn_y_title.R

Defines functions urbn_y_title

Documented in urbn_y_title

#' urbn_y_title
#'
#' Add a horizontal y axis title to a plot created with \code{urbn_plot()}.
#'
#' @param string character string for a y-axis title
#' @param size font size for the y-axis title
#'
#' @return a grob formatted for a y-axis title in a ggplot
#'
#' @export
#'
urbn_y_title <- function(string, size = 8.5) {
  grid::textGrob(string,
                 x = unit(0, "npc"),
                 y = unit(1, "npc"),
                 hjust = 0,
                 vjust = 1,
                 gp = gpar(fontsize = size,
                           fontfamily = "Lato",
                           fontface = "italic"))
}
UrbanInstitute/urbnthemes documentation built on Jan. 26, 2022, 8:34 p.m.