Skip to content

Instantly share code, notes, and snippets.

@thoughtfulbloke
Last active February 5, 2026 23:59
Show Gist options
  • Select an option

  • Save thoughtfulbloke/2defd83006b254191f26ddb3567e2dfc to your computer and use it in GitHub Desktop.

Select an option

Save thoughtfulbloke/2defd83006b254191f26ddb3567e2dfc to your computer and use it in GitHub Desktop.
My standard gig-lot theme as of February 2026
library(ggplot2)
library(ggthemes)
six_cols <- colorblind_pal()(6)
make_footer <- function(x){
paste0(x,"\n Made by David Hood, ", Sys.Date())
}
bodyfont <- "Lexend Deca Thin"
systemfonts::register_variant(name = bodyfont,
family = "Lexend Deca",
weight = "ultralight"
)
headfont <- "Lexend Deca Medium"
systemfonts::register_variant(
name = headfont,
family = "Lexend Deca",
weight = "medium"
)
theme_david <- function(){
theme_minimal(base_family=bodyfont,
header_family=headfont,
base_size = 9,
ink = "#000000",
paper = "#FFFFFF",
accent = "red") %+replace%
theme(axis.line.x = element_line(linewidth=0.2),
axis.line.y = element_line(linewidth=0.2),
axis.ticks = element_line(linewidth=0.2),
axis.title.y.left = element_text(margin = margin(t = 5, r = 7, b = 5, l = 5, unit = "pt")),
axis.title.x.bottom = element_text(margin = margin(t = 7, r = 5, b = 0, l = 5, unit = "pt")),
panel.background = element_rect(fill = "#FFFFFF", colour = "#F7F7F7", linewidth=1),
panel.grid = element_blank(),
plot.title.position = "plot",
plot.title = element_text(lineheight = 1.18, size=12,
margin=margin(t = 5, r = 5, b = 10, l = 10, unit = "pt"),
hjust=0, vjust=0),
plot.subtitle = element_text(lineheight = 1.18, size=10,
margin=margin(t = 0, r = 5, b = 20, l = 10, unit = "pt"),
hjust=0),
plot.background = element_rect(fill = "#FFFFFF", colour="#FFFFFF"),
plot.caption = element_text(margin=margin(t = 2, r = 5, b = 5, l = 5, unit = "pt"),
lineheight = 1.15,
size=8, hjust=1),
plot.caption.position = "plot",
plot.margin = margin(t=10,r=10,b=10,l=10),
strip.text = element_text(margin = margin_part(b = -15, l = 6), hjust=0,
size = rel(1), colour="#00000099"),
strip.clip = "off",
strip.background = element_blank(),
panel.spacing = unit(1, "lines")
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment