Skip to content

Instantly share code, notes, and snippets.

@deep-introspection
Created January 28, 2021 17:17
Show Gist options
  • Save deep-introspection/8c2727ef852bbbe10f30d198d470e1fc to your computer and use it in GitHub Desktop.
Save deep-introspection/8c2727ef852bbbe10f30d198d470e1fc to your computer and use it in GitHub Desktop.
Raincloud plot in Julia
#!/usr/bin/env julia
# author : Guillaume Dumas
# date : 2021-01-28
# notes : inspired by Allen M, Poggiali D, Whitaker K et al.
# https://doi.org/10.12688/wellcomeopenres.15191.2
using StatsPlots
function raincloud(data)
p = violin(data,
side=:left,
show_mean = true,
show_median = true,
quantiles = [0.25, 0.75],
leg=false)
for col in 1:size(data)[2]
display(scatter!(col .+ 0.1 .+ 0.3 .* rand(size(data)[1]),
data[:, col], color=col))
end
end
raincloud(rand(100, 5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment