theme_ul {ggthemeUL}R Documentation

Theme UL

Description

This function creates a ggplot2 theme that follows the visual identity of the University of Ljubljana.

Usage

theme_ul(
  legend.position = "top",
  panel.background.fill = "#E8E9EA",
  plot.background.fill = "white",
  panel.grid.major.color = NULL,
  legend.justification = c(0, 1),
  legend.key = element_rect(fill = "transparent"),
  text = element_text(colour = "#58595b"),
  axis.text = element_text(colour = "#58595b"),
  strip.text.x = element_text(colour = "#58595b"),
  plot.caption = element_text(hjust = 1),
  legend.title = element_text(face = "bold"),
  axis.title = element_text(face = "bold"),
  plot.title = element_text(face = "bold"),
  plot.subtitle = element_text(hjust = 0),
  legend.background = element_rect(fill = "transparent", colour = "transparent"),
  ...
)

Arguments

legend.position

A character string that specifies the position of the legend. Default is "top".

panel.background.fill

A character string that specifies the HEX code for the color of the panel background. Default is "#E8E9EA".

plot.background.fill

A character string that specifies the HEX code for the color of the plot background. Default is "white".

panel.grid.major.color

A character string that specifies the HEX code for the color of the major grid lines. If left as NULL (the default setting), the color will be automatically set according to the panel.background.fill parameter.

legend.justification

A numeric vector of length 2 that determines the justification of the legend. Default is c(0, 1).

legend.key

An element_rect object defining the appearance of the legend key. Default is element_rect(fill = "transparent").

text

A ggplot2 element specifying the appearance of text elements in the plot.

axis.text

A ggplot2 element specifying the appearance of axis text in the plot.

strip.text.x

A ggplot2 element specifying the appearance of strip text for x-axis facet labels.

plot.caption

A ggplot2 element specifying the appearance of the plot caption.

legend.title

A ggplot2 element specifying the appearance of the legend title.

axis.title

A ggplot2 element specifying the appearance of axis titles.

plot.title

A ggplot2 element specifying the appearance of the plot title.

plot.subtitle

A ggplot2 element specifying the appearance of the plot subtitle.

legend.background

A ggplot2 element specifying the appearance of the legend background.

...

Other arguments passed on to the function 'theme()'.

Value

A ggplot2 theme object that can be added to a ggplot.

See Also

theme

Examples

ggplot(data = mtcars, aes(x = disp, y = mpg, color = qsec, size = wt)) +
geom_point() +
labs(y = "Miles per gallon",
x = "Engine size (cu. in.) ",
title = "Larger engine consume more gas",
subtitle = "V-shape engines are typically larger",
caption = "Data source: Motor Trend US magazine.",
color = "1/4 mile time (seconds)",
size = "Weight (1000 lbs)") +
scale_color_ul(palette = "red", discrete = FALSE) +
theme_ul(plot.background.fill = ul_color("lajt"))

[Package ggthemeUL version 0.1.3 Index]