R/set_font.R
set_font.Rd
setting font for ggplot (axis text, label, title, etc.)
set_font(p, family = "sans", fontface = NULL, size = NULL, color = NULL)
ggplot object
font fammily
font face
font size
font color
TableGrob object
Guangchuang Yu
library(grid) library(ggplot2) d <- data.frame(x=rnorm(10), y=rnorm(10), lab=LETTERS[1:10]) p <- ggplot(d, aes(x, y)) + geom_text(aes(label=lab), size=5) set_font(p, family="Times", fontface="italic", color='firebrick')