Skip to content

Instantly share code, notes, and snippets.

@gustavopinto
Created May 13, 2013 19:49
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 gustavopinto/5570951 to your computer and use it in GitHub Desktop.
Save gustavopinto/5570951 to your computer and use it in GitHub Desktop.
line chart in R
seq <- c(78, 78, 78, 78)
thread <- c(80, 60, 55, 42)
executors <- c(80, 56, 42, 31)
forkJoin <- c(79, 55, 52, 54)
actors <-c(82, 47, 38, 30)
plot(thread, type="o", col="blue", pch=18, ylim=c(20, 100))
lines(seq, type="o", pch=23, lty=1, col="darkred")
lines(executors, type="o", pch=24, lty=1, col="purple")
lines(forkJoin, type="o", pch=25, lty=1, col="chocolate3")
lines(actors, type="o", pch=8, lty=1, col="orangered2 ")
abline(v=1,col=1,lty=3)
abline(v=1.5,col=1,lty=3)
abline(v=2,col=1,lty=3)
abline(v=2.5,col=1,lty=3)
abline(v=3,col=1,lty=3)
abline(v=3.5,col=1,lty=3)
abline(v=4,col=1,lty=3)
abline(h=100,col=1,lty=3)
abline(h=80,col=1,lty=3)
abline(h=60,col=1,lty=3)
abline(h=40,col=1,lty=3)
abline(h=20,col=1,lty=3)
box()
labels <- c("Sequential","Thread", "Executors", "ForkJoin", "Scala Actors")
colors <- c("blue","darkred", "purple", "chocolate3", "orangered2")
pch <- c(18,23,24,25,8)
legend(1.0, 50, labels, cex=0.8, col=colors, pch=phc, lty=1,bg = "white")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment