Created
November 2, 2022 14:07
-
-
Save AnupJoseph/9c66d4efd52c2347336733d953b17e7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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