theme_latex: Add LaTeX theme to ggplot object

Description Usage Arguments Examples

View source: R/theme_latex.R

Description

This function changes ggplot object theme to LaTeX and color blind friendly style.

Usage

1
theme_latex(font = "lmroman", base_size = 12)

Arguments

font

character; "lmroman" by default

base_size

numeric; 12 by default

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(ggplot2)
library(ltxplot)
load_theme_ltx()
df <- mtcars
df$carb <- as.factor(df$carb)
ggplot(df, aes(x=carb, fill = carb))+
  geom_bar(stat= "count", width=0.7)+
  labs(title = 'Number of cars with different number of carburetors',
       x = "Number of carburetors",
       y = "Number of car models",
       tag = 'Figure 1',
       caption = "Data source: mtcars") +
  theme_latex(base_size = 14) +
  theme(legend.position = "none")

alicewchen/ltxplot documentation built on May 5, 2021, 12:15 a.m.