Annual industrial robots installed

Author

math4mad

load pacakge

Code
include("utils.jl")
[ Info: loading success

2. load data->dataframe

Code
df=@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)

first(df,5)
5×4 DataFrame
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

3. plot

Code
   row,col=size(df)
   fig=Figure()
   ax=Axis(fig[1,1])
   ax.title="Annual industrial robots installed"
   ax.subtitle="2021"
   ax.yticks=(1:row,df.Entity)
   ax.xgridvisible=false
   ax.ygridvisible=false
   xs=df.Entity
   ys=round.(Int,df.total)
   barplot!(ax,1:row,ys;direction=:x,color=ys,bar_labels=:y,#flip_labels_at=20,
     #color_over_background=:dodgerblue3,
     #color_over_bar=:white,
   )
   
   fig