if (FALSE) {
library(ggplot2)
ggplot(mtcars, aes(x = mpg, y = hp)) +
geom_point() + theme_steve_web() +
labs(title = "A ggplot2 Plot from the Motor Trend Car Road Tests Data",
subtitle = "Notice the prettier fonts, if you have them.",
caption = "Data: ?mtcars in {datasets} in base R.")
ggplot(mtcars, aes(x = mpg, y = hp)) +
geom_point() + theme_steve_web() +
post_bg() +
labs(title = "A ggplot2 Plot from the Motor Trend Car Road Tests Data",
subtitle = "Notice the slight change in background color",
caption = "Data: ?mtcars in {datasets} in base R.")
ggplot(mtcars, aes(x = mpg, y = hp)) +
geom_point() + theme_steve_ms() +
labs(title = "A ggplot2 Plot from the Motor Trend Car Road Tests Data",
subtitle = "Notice the fonts will match the 'cochineal' font package in LaTeX.",
caption = "Data: ?mtcars in {datasets} in base R.")
ggplot(mtcars, aes(x = mpg, y = hp)) +
geom_point() + theme_steve_font(font = "Comic Sans MS") +
labs(title = "A ggplot2 Plot from the Motor Trend Car Road Tests Data",
subtitle = "Notice that this will look ridiculous",
caption = "Data: ?mtcars in {datasets} in base R.")
}
Run the code above in your browser using DataLab