set_font: set_font

View source: R/set_font.R

set_fontR Documentation

set_font

Description

setting font for ggplot (axis text, label, title, etc.)

Usage

set_font(p, family = "sans", fontface = NULL, size = NULL, color = NULL)

Arguments

p

ggplot object

family

font fammily

fontface

font face

size

font size

color

font color

Value

TableGrob object

Author(s)

Guangchuang Yu

Examples

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')

ggfun documentation built on Oct. 30, 2024, 9:13 a.m.