Create a fully customized plot that would be suitable for publication:
# Create a publication-quality plot
pine_df %>%
ggplot(aes(x = wind, y = length_mm, fill = wind)) +
geom_violin(alpha = 0.4) +
geom_boxplot(width = 0.2, alpha = 0.7, outlier.shape = NA) +
geom_jitter(width = 0.1, alpha = 0.5, color = "gray30", size = 2) +
stat_summary(fun = mean, geom = "point", shape = 23, size = 3, fill = "white") +
labs(
title = "Pine Needle Length Varies with Wind Exposure",
subtitle = "Needles on the leeward side tend to be longer",
x = "Tree Side",
y = "Needle Length (mm)",
caption = "Data collected Spring 2023") +
scale_fill_manual(
values = c("wind" = "#1b9e77", "lee" = "#d95f02"),
labels = c("wind" = "Windward", "lee" = "Leeward")) +
theme_minimal() +
theme(
plot.title = element_text(face = "bold", size = 16),
plot.subtitle = element_text(size = 12, color = "gray30"),
axis.title = element_text(face = "bold"),
legend.title = element_blank(),
legend.position = "bottom")