Skip to content

Instantly share code, notes, and snippets.

@leoken
Created November 2, 2013 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leoken/7274655 to your computer and use it in GitHub Desktop.
Save leoken/7274655 to your computer and use it in GitHub Desktop.
browser.names = c("Internet Explorer", "Firefox", "Chrome", "Safari", "Opera", "Mobile", "Others")
browser.years = c(
2013.417, 2013.333, 2013.25, 2013.167, 2013.083, 2013,
2012.917, 2012.833, 2012.75, 2012.667, 2012.583, 2012.5, 2012.417, 2012.333, 2012.25, 2012.167, 2012.083, 2012,
2011.917, 2011.833, 2011.75, 2011.667, 2011.583, 2011.5, 2011.417, 2011.333, 2011.25, 2011.167, 2011.083, 2011,
2010.917, 2010.833, 2010.75, 2010.667, 2010.583, 2010.5, 2010.417, 2010.333, 2010.25, 2010.167, 2010.083, 2010,
2009.917, 2009.833, 2009.75, 2009.667, 2009.583, 2009.5, 2009.417, 2009.333, 2009.25, 2009.167, 2009.083, 2009,
2008.917, 2008.833, 2008.75, 2008.667, 2008.583)
browser.ie = c(
11.72,11.71,11.3,11.82,11.71,12.78,
12.23,13.08,13.70,15.85,20.04,25.31,32.12,34.07,34.81,35.75,37.45,38.65,
40.63,40.18,41.66,41.89,42.45,43.58,43.87,44.52,45.11,45.44,46.00,46.94,
48.16,49.21,49.87,51.34,52.68,52.86,52.77,53.26,54.44,54.50,55.25,55.72,
56.57,57.96,58.37,58.69,60.11,59.49,62.09,61.88,62.52,64.43,65.41,67.84,
68.14,67.68,67.16,68.91,68.57)
browser.firefox = c(
19.76,20.06,20.87,21.34,21.42,21.89,
22.37,22.32,22.40,22.85,23.73,24.56,25.55,24.87,24.98,24.88,24.78,25.27,
25.23,26.39,26.79,27.49,27.95,28.34,29.29,29.67,29.98,30.37,30.68,30.76,
31.17,31.24,31.50,31.09,30.69,31.15,31.64,31.74,31.27,31.83,31.64,31.97,
32.21,31.82,31.34,31.28,30.50,30.26,28.75,29.67,29.40,27.85,27.03,25.23,
25.27,25.54,25.77,26.08,26.14)
browser.chrome = c(
41.38,39.15,38.07,37.09,36.52,36.42,
35.72,34.77,34.21,33.59,33.81,32.76,32.43,31.23,30.87,29.84,28.40,27.27,
25.69,25.00,23.61,23.16,22.14,20.65,19.36,18.29,17.37,16.54,15.68,14.85,
13.35,12.39,11.54,10.76, 9.88, 9.24, 8.61, 8.06, 7.29, 6.71, 6.04, 5.45,
4.66, 4.17, 3.69, 3.38, 3.01, 2.80, 2.42, 2.07, 1.73, 1.52, 1.38, 1.21,
0.93, 1.02, 1.03, NA, NA)
browser.safari = c(
7.96, 8.00, 8.50, 8.60, 8.29, 7.92,
7.83, 7.81, 7.70, 7.39, 7.12, 7.00, 7.09, 7.13, 6.72, 6.77, 6.62, 6.08,
5.92, 5.93, 5.60, 5.19, 5.16, 5.07, 5.01, 5.04, 5.02, 5.08, 5.09, 4.79,
4.70, 4.56, 4.42, 4.23, 4.09, 4.07, 4.14, 4.23, 4.16, 4.08, 3.76, 3.48,
3.67, 3.47, 3.28, 3.25, 3.02, 2.91, 2.65, 2.75, 2.73, 2.59, 2.57, 2.41,
2.49, 2.91, 3.00, 2.99, 3.30)
browser.opera = c(
1.00, 1.01, 1.17, 1.22, 1.19, 1.26,
1.39, 1.63, 1.61, 1.63, 1.72, 1.77, 1.77, 1.72, 1.78, 2.02, 1.95, 1.98,
1.82, 1.81, 1.72, 1.67, 1.66, 1.74, 1.84, 1.91, 1.97, 2.00, 2.00, 2.07,
2.01, 2.00, 2.03, 1.88, 1.91, 1.91, 1.96, 1.82, 1.97, 1.97, 2.00, 2.06,
2.02, 1.88, 2.62, 2.67, 2.64, 3.46, 3.23, 2.96, 2.94, 2.95, 2.92, 2.83,
3.01, 2.69, 2.86, 1.83, 1.78)
browser.mobile = c(
14.62,13.90,14.44,14.35,14.13,14.55,
13.08,12.30,12.03,11.78,11.09,10.40,10.11, 9.58, 8.99, 8.53, 8.49, 8.04,
6.95, 6.55, 6.74, 7.12, 7.02, 6.53, 5.75, 5.21, 4.70, 4.45, 4.30, 4.10,
4.02, 3.81, 3.50, 3.21, 2.86, 2.57, 2.32, 2.18, 1.96, 1.72, 1.56, 1.28,
1.21, 1.15, 1.12, 1.12, 1.05, 0.94, 0.86, 0.86, 0.80, 0.69, 0.67, 0.60,
NA, NA, NA, NA, NA)
browser.title = "Usage share of web browsers"
browser.sub = "Source: StatCounter"
browser.file = "Usage share of web browsers (Source StatCounter).svg"
svg(file=browser.file)
par(lwd=2)
plot(browser.years, browser.ie, type="l", ylim=c(0, 70), main=browser.title, sub=browser.sub, xlab="Year", ylab="Percent", col=1)
lines(browser.years, browser.firefox, col=2)
lines(browser.years, browser.chrome, col=3)
lines(browser.years, browser.safari, col=4)
lines(browser.years, browser.opera, col=5)
lines(browser.years, browser.mobile, col=6)
legend("topright",inset=0.04,col=1:6,lwd=3,legend=browser.names)
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment