Distribution plot 1
Category: distribution
library(tidyverse)
library(wesanderson)
# https://github.com/allisonhorst/palmerpenguins
library(palmerpenguins)
p <- ggplot(penguins, aes(species, flipper_length_mm)) +
geom_jitter(aes(color = species), alpha = 0.75, size = 3, show.legend = FALSE) +
geom_violin(aes(fill = species), alpha = 0.25, show.legend = FALSE) +
geom_boxplot(outlier.size = 0, width = 0.2, alpha = 0.75, show.legend = FALSE) +
scale_color_manual(values = wes_palette('BottleRocket2')) +
scale_fill_manual(values = wes_palette('BottleRocket2')) +
scale_y_continuous(labels = scales::comma) +
theme_bw() +
labs(y = 'Flipper length [mm]') +
theme(
axis.title.x = element_blank(),
panel.grid.major.x = element_blank()
)
ggsave('1.png', p, height = 5, width = 6)