Skip to content

Instantly share code, notes, and snippets.

@AnupJoseph
Created November 2, 2022 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AnupJoseph/9c66d4efd52c2347336733d953b17e7e to your computer and use it in GitHub Desktop.
Save AnupJoseph/9c66d4efd52c2347336733d953b17e7e to your computer and use it in GitHub Desktop.
Gadfly.with_theme(:dark) do
programming_exp = "For how many years have you been writing code and/or programming?"
experience_subset = select(dataset,programming_exp)
# Filter missing variables and count the number of respondents per each group
filter!(programming_exp => x->!ismissing(x),experience_subset)
experience_counts = combine(
groupby(experience_subset,programming_exp),
nrow=>:num_counts
)
# Make custom color scheme
colors = [colorant"#FE4365" for x=1:6]
push!(colors,colorant"gray")
sort!(experience_counts,programming_exp)
experience_plot = plot(
experience_counts,
x=programming_exp,
y=:num_counts,
color=colors,
style(bar_spacing=2mm),
Geom.bar
)
draw(SVG("kaggle_experience_plot.svg"),experience_plot)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment