Skip to content

Instantly share code, notes, and snippets.

@xvzftube
Created November 3, 2022 02:04
Show Gist options
  • Save xvzftube/c2f792fa84af5a4196037485c7d81ee1 to your computer and use it in GitHub Desktop.
Save xvzftube/c2f792fa84af5a4196037485c7d81ee1 to your computer and use it in GitHub Desktop.
theme_gruv.R
library(ftplottools)
library(ggplot2)
library(ggtext)
theme_gruv <- function(){
title_text_color <- "#ebdbb2"
other_text_color <- "#ebdbb2"
grid_line_color <- "#ebdbb2"
panel_background <- "#32302f"
font_family <- "SauceCode Pro Nerd Font"
ft_theme() %+replace%
theme(
plot.title = ggplot2::element_text(
color = title_text_color,
family = font_family,
size = 24
),
plot.subtitle = ggplot2::element_text(
color = other_text_color,
family = font_family
),
plot.caption = ggplot2::element_text(
color = other_text_color,
family = font_family
),
axis.title = ggplot2::element_text(
color = other_text_color,
family = font_family
),
axis.text = ggplot2::element_text(
color = other_text_color,
family = font_family
),
axis.line = ggplot2::element_line(
colour = grid_line_color
),
axis.ticks = ggplot2::element_line(
color = grid_line_color
),
panel.grid.major.y = ggplot2::element_line(
color = grid_line_color
),
legend.title = ggplot2::element_text(color = other_text_color),
legend.text = ggplot2::element_text(
color = other_text_color,
family = font_family
),
plot.background = element_rect(fill = panel_background),
complete = TRUE
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment