library(ggplot2)
library(palmerpenguins)
# default
p <- ggplot(penguins, aes(x = bill_depth_mm, y = bill_length_mm, color = species)) +
geom_point() +
labs(
title = "Bill length and depth of penguins",
subtitle = "Dimensions for Adelie, Chinstrap, and Gentoo Penguins",
x = "Bill depth (mm)",
y = "Bill length (mm)",
color = "Species",
caption = "Source: palmerpenguins package."
)
p
# vs. with Duke theme
p +
theme_duke()
# vs. with Duke theme and scale
p +
scale_duke_color_discrete() +
theme_duke()
# with Duke theme, scale, and further customization to theme
p +
scale_duke_color_discrete() +
theme_duke() +
theme(
plot.title = element_text(color = "red", size = 20),
plot.background = element_rect(fill = "pink", color = "yellow"),
panel.grid = element_blank()
)
Run the code above in your browser using DataLab