Created
October 3, 2012 22:11
-
-
Save mgcdanny/3830216 to your computer and use it in GitHub Desktop.
Overlapping Dot Chart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set.seed(1) | |
performance = rnorm(10,10,3) | |
effort = rnorm(10,10,3) | |
model = LETTERS[seq(1,10)] | |
Db = data.frame(Performance = performance, Effort = effort, Model = model) | |
Db$Distance = Db$Performance - Db$Effort | |
xMax = max(Db$Performance, Db$Effort) | |
Db = Db[order(Db$Distance),] | |
dotchart(Db$Performance, labels=rev(Db$Model), cex=1, xlim=c(0,xMax), pch = 16, col="forestgreen", main="Some Title") | |
par(new=T) | |
dotchart(Db$Effort, labels=rev(Db$Model), cex=1, xlim=c(0,xMax), pch= 4, col="black") | |
abline(v=c(0,5,10), lty = 3) | |
legend("bottomright", legend = c("Performance", "Effort"), col = c("forestgreen", "black"), bg="white", pch =c(16,4), cex=.7) | |
mtext(c("0%", "5%", "10%"), at =c(0,5,10), 3, line=c(0), cex=.5) | |
mtext("Data from some date here",las=1,line=2.5, cex=.6, side=1) | |
mtext("Sorted by Distance Between Performance and Effort",las=1,line=3.5, cex=.6, side=1) | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment