# create the NZ and country comparisons chart 1990 to 2021
svg(filename="Per-capita-greenhouse-gas-emissions-2021.svg", width = 8, height = 6, pointsize = 12, onefile = FALSE, family = "sans", bg = "white", antialias = c("default", "none", "gray", "subpixel"))
par(mar=c(2.7,2.7,1,1)+0.1)
plot(data3$year,data3$nz2,ylim=c(0,25), xlim=c(1989.5,2021),tck=0.01,axes=FALSE,ann=FALSE, type="n",las=1)
axis(side=1, tck=0.01, las=0,tick=TRUE)
axis(side=2, tck=0.01, las=1, at = NULL, labels = TRUE, tick = TRUE)
axis(side=3, tck=0.01, las=0,at = NULL, labels = FALSE, tick=TRUE)
axis(side=4, tck=0.01, at = NULL, labels = FALSE, tick = TRUE)
box()
grid()
points(data3$year,data3$nz2,col=1 ,pch=19)
lines(data3$year,data3$nz2,col=1,lwd=1,lty=1)
lines(data3$year,data3$uk,col="#1b9e77",lwd=2)
points(data3$year,data3$uk,col="#1b9e77",pch=15)
lines(data3$year,data3$europe,col="#d95f02",lwd=2)
points(data3$year,data3$europe,col="#d95f02",pch=16)
lines(data3$year,data3$china,col="#7570b3",lwd=2)
points(data3$year,data3$china,col="#7570b3",pch=17)
lines(data3$year,data3$world,col="#e7298a",lwd=2)
points(data3$year,data3$world,col="#e7298a",pch=18)
lines(data3$year,data3$india,col="#66a61e",lwd=2)
points(data3$year,data3$india,col="#66a61e",pch=25,bg="#66a61e")
lines(data3$year,data3$africa,col="#e6ab02",lwd=2)
points(data3$year,data3$africa,col="#e6ab02",pch=20,cex=1.2)
text(2021,18,"New Zealand",cex=1.2,adj=1,col=1)
text(1990,15,"United Kingdom",cex=1.2,adj=0,col=1)
text(1990,11,"Europe",cex=1.2,adj=0,col=1)
text(1990,8,"World Average",cex=1.2,adj=0,col=1)
text(2021,10.5,"China",cex=1.2,adj=1,col=1)
text(2021,4.5,"Africa",cex=1.2,adj=1,col=1)
text(2021,1.5,"India",cex=1.2,adj=1,col=1)
mtext(side=1,cex=0.8,line=-1.1,"Data: Our World in Data https://ourworldindata.org/grapher/per-capita-ghg-emissions")
mtext(side=3,cex=1.4, line=-3.9,expression(paste("New Zealand per capita greenhouse gas emissions comparisons \n1990 - 2021")) )
mtext(side=2,cex=1, line=-1.35,expression(paste("tonnes of greenhouse gas in C", O[2], " equivalent")))
dev.off()