Skip to content

Instantly share code, notes, and snippets.

@masaha03
Created January 21, 2013 10:43
Show Gist options
  • Save masaha03/4585202 to your computer and use it in GitHub Desktop.
Save masaha03/4585202 to your computer and use it in GitHub Desktop.
legend2 <- legend
body(legend2)[[49]] <- quote(
invisible(list(rect = list(w = w, h = h, left = left, top = top),
text = list(x = xt, y = yt), points = list(x = x1, y = y1)))
)
plot(-100:100, -100:100, type = "b")
myLegend <- legend2(1, .8, bty = 'n', c('sugar','citrus','none'), pch = 21,
pt.bg = 'white', pt.lwd = 0, lty = c(1, 2, 3), lwd = 1.5, title = "Condition",
pt.cex = c(1.8), cex = 1.5)
points(myLegend$points$x, myLegend$points$y, pch = 15, col="white", cex = 2)
points(myLegend$points$x, myLegend$points$y, pch = c('s','c','u'), cex = 1.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment