Code
include("utils.jl")[ Info: loading success
include("utils.jl")[ Info: loading success
make_title("Part One : Data Processing") df=@pipe CSV.File("./data/cost-space-launches-low-earth-orbit.csv")|>DataFrame
df =@chain df begin
@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") axis = (width = 600, height =1200)
data_layer=data(df)
mapping_layer1=mapping(:Year,:cost_per_kg,color=:launch_class)
visual_layer1 = visual(Scatter;strokewidth=2,strokecolor=:black)
mapping_layer2=mapping(:Year,:cost_per_kg, text=:Entity => verbatim)
visual_layer2 = visual(Makie.Text;color=:black)
plt=data_layer*mapping_layer1*visual_layer1
text_pipe=data_layer*mapping_layer2*visual_layer2
draw(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