# create Plot 1, a line chart png("/home/simon/R/global-temp-master/gistempsyearly-560by420-2016-12.png", bg="white", width=560, height=420,pointsize = 14) par(mar=c(2.7,2.7,1,1)+0.1) plot(gistempsyearly,ylim=c(-0.6,1.2), xlim=c(1878,2016),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 = c(-0.6,-0.4,-0.2, 0,0.2,0.4,0.6,0.8,1), labels = TRUE, tick = TRUE) axis(side=4, tck=0.01, at = c(-0.6,-0.4,-0.2, 0,0.2,0.4,0.6,0.8,1), labels = FALSE, tick = TRUE) lines(gistempsyearly,col="#F32424",lwd=3) mtext(side=1,cex=1,line=-1.2,"Data: NASA Goddard Institute for Space Studies\nhttps://github.com/datasets/global-temp") mtext(side=3,cex=1.5, line=-4,expression(paste("GISTEMP Global Land-Ocean Temperature \nAnomaly 1880 2016")) ) mtext(side=2,cex=1, line=-1.3,"Anomaly from 1951-1980 mean (C)") mtext(side=4,cex=0.75, line=0.05,R.version.string) text(2013,1,adj=1,"2016",cex=1) points(gistempsyearly[["Year"]][137],gistempsyearly[["Mean"]][137],col="#000099",pch=19) box() dev.off() # create Plot 2, a line chart with a lowess smoother png("/home/simon/R/global-temp-master/gistempsyearlylowess-560by420-2016.png", bg="white", width=560, height=420,pointsize = 14) par(mar=c(2.7,2.7,1,1)+0.1) plot(gistempsyearly,ylim=c(-0.6,1.2), xlim=c(1878,2016),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 = c(-0.6,-0.4,-0.2, 0,0.2,0.4,0.6,0.8,1), labels = TRUE, tick = TRUE) axis(side=4, tck=0.01, at = c(-0.6,-0.4,-0.2, 0,0.2,0.4,0.6,0.8,1), labels = FALSE, tick = TRUE) box() lines(gistempsyearly,col="1",lwd=1) points(gistempsyearly,col="#000099",pch=19) lines(lowess(gistempsyearly[["Year"]],gistempsyearly[["Mean"]],f=0.1),lwd=3,col="#CC0000") mtext(side=1,cex=0.9,line=-1.1,"Data: NASA Goddard Institute for Space Studies\nhttps://github.com/datasets/global-temp") mtext(side=3,cex=1.5, line=-4,expression(paste("GISTEMP Global Land-Ocean Temperature \nAnomaly 1880 2016")) ) mtext(side=2,cex=1, line=-1.3,"Degrees Celsius 0 = 1951 to 1980 mean") legend(1890, 1,bty='n',bg="white", c(paste("Mean", c("annual anomaly", "lowess smoothed \nanomaly 11 years f =0.1"))),pch=c(19,NA),lty=c(1,1),lwd=c(1,3),col=c("#000099","#CC0000")) mtext(side=4,cex=0.75, line=0.05,R.version.string) text(2013,1,adj=1,"2016",col=1,cex=1) dev.off()