TODO

  • Think about effect of ggplot2::coord_cartesian(expand = FALSE) - And also maybe add clip = 'off' - Add spacing between title and subtitle. - Consider adding KU logo watermark in corner (with option in function to turn it off). - Lighten the axis tick labels.

theme_ku(
  base_size = 10,
  base_family = c("Arial Narrow", "Arial", "Raleway", "sans"),
  base_line_size = base_size/22,
  base_rect_size = base_size/22,
  title_position = "plot",
  legend_position = "plot",
  verbose = FALSE
)

Arguments

base_size

double, base font size (default: 10)

base_family

character, font family in order of preference; first found will be used (default: c("Arial Narrow", "Arial", "Raleway", "sans"))

base_line_size

double, line size (default: base_size / 22)

base_rect_size

double, rect size (default: base_size / 22)

title_position

character, c("plot", "pane")

legend_position

character, c("plot", "right")

verbose

logical, whether to show feedback

Details

Notes

  • Please run extrafont::font_import() once in your renv environment before using this function. You should also run it for any other non-standard directories where you operating system keeps fonts. For instance, on Windows, you can import user-installed fonts with extrafont::font_import(path.expand("~/AppData/Local/Microsoft/Windows/Fonts")). If you get an error when importing fonts, you may need to downgrade the Rttf2pt1 package to version 1.3.8 by running remotes::install_version("Rttf2pt1", version = "1.3.8").

Examples

if (interactive()) {
  library(ggplot2)
  library(kubrand)
  ggplot2::ggplot(datasets::mtcars, ggplot2::aes(x = mpg)) +
    ggplot2::geom_dotplot(method = "histodot", binwidth = 1.5) +
    kubrand::theme_ku()
}