theme_pitch: Removes background and axes details from a ggplot plot.

View source: R/theme_pitch.R

theme_pitchR Documentation

Removes background and axes details from a ggplot plot.

Description

Functionally very similar to ggplot2::theme_void.

Usage

theme_pitch(aspect_ratio = 68/105)

Arguments

aspect_ratio

Aspect ratio (y / x) for the plot. Use NULL to let the plot take any aspect ratio.

Value

list of ggplot themes to be added to a ggplot plot

Examples

library(ggplot2)

shots_data <- data.frame(x = c(90, 85, 82, 78, 83),
                         y = c(43, 40, 52, 56, 44))

p <- ggplot(shots_data, aes(x = x, y = y)) +
  annotate_pitch() +
  geom_point()

# Pitch fixed to 68/105 by default
p + theme_pitch()

# Free aspect
p + theme_pitch(aspect_ratio = NULL)


Torvaney/ggsoccer documentation built on April 7, 2024, 8:03 a.m.