Code
include("utils.jl")[ Info: loading success
load pacakge
include("utils.jl")[ Info: loading success
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)| 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 |
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