Code
include("utils.jl")
[ Info: loading success
load pacakge
include("utils.jl")
[ Info: loading success
=@pipe CSV.File("./data/annual-industrial-robots-installed.csv")|>DataFrame|>coalesce.(_, 0.0)|>rename!(_,"Total number of industrial robots installed by contry, 2021"=>:total)|>sort(_,:total)
df
first(df,5)
Row | Entity | Code | Year | total |
---|---|---|---|---|
String15 | String3 | Int64 | Int64 | |
1 | Poland | POL | 2021 | 3300 |
2 | Spain | ESP | 2021 | 3400 |
3 | Singapore | SGP | 2021 | 3500 |
4 | Thailand | THA | 2021 | 3900 |
5 | Canada | CAN | 2021 | 4300 |
=size(df)
row,col=Figure()
fig=Axis(fig[1,1])
ax="Annual industrial robots installed"
ax.title="2021"
ax.subtitle=(1:row,df.Entity)
ax.yticks=false
ax.xgridvisible=false
ax.ygridvisible=df.Entity
xs=round.(Int,df.total)
ysbarplot!(ax,1:row,ys;direction=:x,color=ys,bar_labels=:y,#flip_labels_at=20,
#color_over_background=:dodgerblue3,
#color_over_bar=:white,
)
fig