I am having trouble formatting my legend. I would like to increase the vertical space between each element of the legend.
I post the image it produces and the code so yo
When you consult the legend
manual, for example by typing ?legend
into your R console, you find
Arguments
...
x.intersp - character interspacing factor for horizontal (x) spacing.
y.intersp - the same for vertical (y) line distances.
To fix your legend, you could start with an interspacing factor of 2, so your legend
call would become
legend("right", c(
"$\\lambda < \\lambda_{cr}$ ",
"$\\lambda < \\lambda_{cr}$",
"$\\lambda = \\lambda_{cr}$ ",
"$\\lambda = \\lambda_{cr}$ "
), xpd = TRUE, inset = c(0,0), bty = "n", lty = c(1, 1, 1, 1),
lwd=2, col = c("black","green4","red","blue"),
y.intersp=2)
If that gives you too much or too little space between the items, adjust the value accordingly.