thanhleviet
10/8/2015 - 4:12 PM

Simple but neat plot of dengue cases and countries over 50 years (1955 - 2007)

Simple but neat plot of dengue cases and countries over 50 years (1955 - 2007)

options(scipen=6)
year <- c("1955-1959", "1960-1969", "1970-1979", "1980-1989", "1990-1999","2000-2007")
case <- c(908, 15497, 122174, 295554, 479848, 968564)
countries <- c(2, 7, 14, 38, 52, 66)
par(mar = c(5,6,2,5))
ratio <- 1e6/70
bar <- barplot(case, col = "#80B31A", axes = F, 
               ylim=c(0,1000000), width = 0.5)
lines(x = bar, y = countries*ratio, lwd = 2.5, col = "#C45353", lty = 4)
points(x = bar, y = countries*ratio, pch = 19, col = "#C45353", cex = 1.3)
axis(side = 2, labels = c(0,"200,000","400,000","600,000","800,000","1000,000"), at = c(0,200000,400000,600000,800000,1000000), las = 2, lwd = 2)
axis(side = 4, labels = c(0,10,20,30,40,50,60,70), at = seq(0,1e6, length.out = 8), las = 2, col = "#C45353", lwd = 2)
mtext(side = 2, line = 4.5, "No of cases", cex = 1.2)
mtext(side = 4, line = 2.5, "No of countries", cex = 1.2)
text(cex=1, x=bar*1.1, y=-5, year, xpd=T, srt=45, adj = 1.2)