set_font | R Documentation |
setting font for ggplot (axis text, label, title, etc.)
set_font(p, family = "sans", fontface = NULL, size = NULL, color = NULL)
p |
ggplot object |
family |
font fammily |
fontface |
font face |
size |
font size |
color |
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.