exit-capacity.R 637 B

123456789101112131415161718192021222324
  1. ## Read data
  2. t <- read.table("exit-capacity.dat", header=TRUE)
  3. ## Normalize columns
  4. t[,2] <- t[,2]/max(t[,2])*100
  5. t[,3] <- t[,3]/max(t[,3])*100
  6. ## Remove uninteresting ports
  7. ports <- c(22, 25, 80, 119, 135, 443,
  8. 563, 8080, 6667)
  9. t <- t[t$port %in% ports,]
  10. ## Plot
  11. pdf("exit-capacity.pdf")
  12. par(las=1)
  13. col <- grey(c(1,4)/5)
  14. barplot(t(as.matrix(t[,2:3])), names=t$port,
  15. beside=TRUE, xlab="Port number",
  16. ylab="Exit capacity available (%)",
  17. col=col, cex.axis=0.8, cex.names=0.8)
  18. par(xpd=TRUE)
  19. legend(x="topright", legend=c("Nodes", "Bandwidth"),
  20. fill=col, bty="n", inset=c(-0.05,-0.15))
  21. dev.off()