Description Usage Arguments Examples
This function changes ggplot object theme to LaTeX and color blind friendly style.
1 | theme_latex(font = "lmroman", base_size = 12)
|
font |
character; "lmroman" by default |
base_size |
numeric; 12 by default |
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.