Code
include("utils.jl")
[ Info: loading success
load pacakge
include("utils.jl")
[ Info: loading success
=@pipe CSV.File("./data/temperature-anomaly.csv")|>DataFrame|>DataFrame|>coalesce.(_, 0.0)|>rename!(_,
df"Global average temperature anomaly relative to 1961-1990"=>:mean, "Upper bound of the annual temperature anomaly (95% confidence interval)"=>:upper, "Lower bound of the annual temperature anomaly (95% confidence interval)"=>:lower
)
=groupby(df,:Entity)
gdf= @pipe keys(gdf) .|> values(_)[1] cats
3-element Vector{String31}:
"Global"
"Northern hemisphere"
"Southern hemisphere"
=Figure()
fig=[Axis(fig[i,1]) for i in 1:3]
axsfunction plot_ci(df,ax,title)
=title
ax.title=df.Year,df.mean,df.lower,df.upper
xs,mean,lower,upperhlines!(ax,[0],linestyle=:dot,color=(:red,0.8))
lines!(ax,xs,mean,color=:blue)
band!(ax,xs,lower,upper,color=(:lightgreen,0.5))
end
#plot_ci(gdf[1],axs[1],title="blank")
for (idx, df) in enumerate(gdf)
plot_ci(df,axs[idx],cats[idx])
end
fig