Skip to content

Instantly share code, notes, and snippets.

@friscojosh
Last active November 2, 2022 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save friscojosh/a4b9e571bb3aa1aef5406b359b32c627 to your computer and use it in GitHub Desktop.
Save friscojosh/a4b9e571bb3aa1aef5406b359b32c627 to your computer and use it in GitHub Desktop.
arrows
arrows <-
tibble(
x1 = -.06,
x2 = -.01,
y1 = 600,
y2 = 500
)
all_N_week_means |>
ggplot(aes(x = epa)) +
geom_histogram(bins = 100,
color="#ffffff",
fill="#E77349", ) +
geom_vline(xintercept = current, color = "#000000", linetype="dashed") +
# these are the important bits
annotate("text", x = -0.08, y = 650, label = "2022 EPA/play", size = 3) +
geom_curve(
data = arrows, aes(x = x1, y = y1, xend = x2, yend = y2),
arrow = arrow(length = unit(0.08, "inch")), size = 0.5,
color = "gray20", curvature = 0.3) +
#####
theme_minimal() +
facet_wrap(~year) +
labs(title = "Teams are struggling slightly against 2-high coverages",
x = "Explected Points Added per play", y = "",
subtitle = "EPA per play calculated from random six week samples of regular season plays from 2016-21.",
caption = "SOURCE: ESPN Stats & Info Group") +
theme(panel.grid.minor.y = element_blank(),
panel.grid.minor.x = element_blank())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment