... when specifying "topright" & put symbols on right side of legend rather than to the left of the labels.
Basically I want my legend to be in a box on the top right corner of my plot, and have all my text right-aligned, not left aligned.
My code is in a loop and applied to over 100 graphs, so I'm trying to keep the legend in the same spot in each graph.
I tried using just
and adj
which did not work for me.
legend("topright", legend=c("data", "data", "data", "data", "data",
"data", "data", "data", "data", "data", "data"),
ncol = 1,
lty = c(1, NA, NA, NA, NA, 1, 1, 1, 2, 2, 2),
pch = c(NA, sym[1], sym[2], sym[2], sym[3], 19, 17, 15, 19, 17, 15),
col = c(blue, aa, aa, aa, aa, gr, bl, pu, gr, bl, pu),
pt.bg = c(NA, a, b, c, d, NA, NA, NA, NA, NA, NA),
pt.cex = c(NA, 1, 1, 1, 1, .5, .5, .5, .5, .5, .5),
cex = .75,
lwd = c(2, NA, NA, NA, NA, 1, 1, 1, 1, 1, 1),
text.col = "black")