Skip to content

Instantly share code, notes, and snippets.

@diamonaj
Created November 23, 2016 22:19
Show Gist options
  • Select an option

  • Save diamonaj/83449e7769555576919af722fa6d4338 to your computer and use it in GitHub Desktop.

Select an option

Save diamonaj/83449e7769555576919af722fa6d4338 to your computer and use it in GitHub Desktop.
left.panel <- c(23, 18, 14, 10, 11, 10, 9, 10, 10, 9)
par(mfrow = c(1,2))
plot(x = c(1:10), left.panel, type = "l", lty = 1, lwd = 3,
ylim = c(5, 25), ylab = "mean squared error", xlab = "degree of polynomial")
plot(x = c(1:10), left.panel, type = "l", lty = 1, lwd = 3,
ylim = c(5, 25), ylab = "mean squared error", xlab = "degree of polynomial")
for(i in 1:6) {
lines(x = c(1:10), y = jitter(left.panel, 10), col = i)
}
#INTENTIONALLY AMBIGUOUS FIGURES
dev.off()
left.panel.bad <- c(rep(15, 10))
left.panel.bad.j <- jitter(left.panel.bad, 15)
par(mfrow = c(1,2))
plot(x = c(1:10), left.panel.bad.j, type = "l", lty = 1, lwd = 3,
ylim = c(5, 25), ylab = "mean squared error", xlab = "degree of polynomial")
plot(x = c(1:10), left.panel.bad.j, type = "l", lty = 1, lwd = 3,
ylim = c(5, 25), ylab = "mean squared error", xlab = "degree of polynomial")
for(i in 1:6) {
lines(x = c(1:10), y = jitter(left.panel.bad, 14), col = i)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment