Skip to content
David Persson edited this page Jul 23, 2011 · 1 revision

R script for generating graphs

the r project

solar <- read.csv("~/Desktop/R/solar.csv")
lithium <- read.csv("~/Desktop/R/baselithium.csv")
lithiumnoroutes <- read.csv("~/Desktop/R/lithium_no_routes.csv")

plot(
        solar$requests.per.second, pch=16, col="red", ylim=c(595, 725),
        xlab="Runs", ylab="reqs/sec", main="Throughput of PHP Web Application Frameworks"
)
points(lithium$requests.per.second, col="blue", pch=10)
points(lithiumnoroutes$requests.per.second, col="green", pch=12)

ms <- mean(solar)
ml <- mean(lithium)
mln <- mean(lithiumnoroutes)

sds <- sd(solar)
sdl <- sd(lithium)
sdln <- sd(lithiumnoroutes)

psolar <- abline(h=c(ms, ms+sds, ms-sds), col="red", lty=c("solid", "dotted", "dotted"))
plithium <- abline(h=c(ml, ml+sdl, ml-sdln), col="blue", lty=c("solid", "dotted", "dotted"))
plithiumnoroutes <- abline(h=c(mln, mln+sdln, mln-sdln), col="green", lty=c("solid", "dotted", "dotted"))

legend(
        680, c("Solar-beta", "Lithium 0.2 - no routing", "Lithium 0.2"),
        pch=c(16, 12, 10), col=c("red", "green", "blue")
)

text(
        y=c(ms+sds+3, ml+sdl+3, mln+sdln+3), x=4, cex=0.75,
        labels=c(
                expression(paste(mu, " = 711.0 +/- 2.0")),
                expression(paste(mu, " = 601.9 +/- 2.8")),
                expression(paste(mu, " = 695.1 +/- 2.4"))
        )
)

Resources

Clone this wiki locally