Skip to content

Instantly share code, notes, and snippets.

View tanerumit's full-sized avatar
💭
I may be slow to respond.

Umit Taner, Ph.D. tanerumit

💭
I may be slow to respond.
View GitHub Profile
@tanerumit
tanerumit / Custom font in ggplot2.R
Last active January 16, 2021 13:45 — forked from dsparks/Custom font in ggplot2.R
#R #ggplot2 use any font on the system
require(extrafont)
require(ggplot2)
font_import(pattern = "GIL", prompt = FALSE) # Import Gill family
loadfonts(device="win") # Load them all
fonts() # See what fonts are available
zp1 <- ggplot(data = iris,
aes(x = Sepal.Length, y = Sepal.Width, label = Species))
zp1 <- zp1 + geom_text(family = "Gill Sans MT")
zp1 <- zp1 + theme(text=element_text(family="Gill Sans Ultra Bold"))