Code
include("utils.jl")
[ Info: loading success
include("utils.jl")
[ Info: loading success
make_title("Part One : Data Processing")
=@pipe CSV.File("./data/cost-space-launches-low-earth-orbit.csv")|>DataFrame
df=@chain df begin
df @select(1,3,4,5)
@arrange(Year)
@filter(Entity ∉ ["Delta E","Scout","Minotaur I","Space Shuttle"])
end
first(df,5)
Row | Entity | Year | cost_per_kg | launch_class |
---|---|---|---|---|
String31 | Int64 | Int64 | String7 | |
1 | Kosmos | 1962 | 14900 | Small |
2 | Atlas Centaur | 1963 | 29500 | Medium |
3 | Titan II | 1964 | 30600 | Medium |
4 | Proton | 1965 | 8200 | Heavy |
5 | Titan III+ | 1965 | 21000 | Medium |
make_title("Part Two : Plots")
= (width = 600, height =1200)
axis =data(df)
data_layer=mapping(:Year,:cost_per_kg,color=:launch_class)
mapping_layer1= visual(Scatter;strokewidth=2,strokecolor=:black)
visual_layer1 =mapping(:Year,:cost_per_kg, text=:Entity => verbatim)
mapping_layer2= visual(Makie.Text;color=:black)
visual_layer2 =data_layer*mapping_layer1*visual_layer1
plt=data_layer*mapping_layer2*visual_layer2
text_pipedraw(plt+text_pipe,axis=axis)
┌ Warning: Keyword argument `bgcolor` is deprecated, use `backgroundcolor` instead.
└ @ Makie ~/.julia/packages/Makie/RgxaV/src/makielayout/blocks/legend.jl:23