Skip to content

Instantly share code, notes, and snippets.

@adamhsparks
Last active May 16, 2017 03:42
Show Gist options
  • Save adamhsparks/87e90a48fee43e7420132df839fa02fc to your computer and use it in GitHub Desktop.
Save adamhsparks/87e90a48fee43e7420132df839fa02fc to your computer and use it in GitHub Desktop.
scatter_violin <- ggplot(data = dat, aes(x = condition, y = value)) +
geom_violin(aes(fill = condition, color = condition)) +
geom_crossbar(stat = "summary", fun.y = mean, fun.ymax = mean, fun.ymin = mean, fatten = 2, width = .5) +
geom_point(color = "black", size = 1, position = position_jitter(w = 0.05)) +
theme_minimal()
# original: https://inattentionalcoffee.wordpress.com/2017/02/14/data-in-the-raw-violin-plots/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment