Greek letters in legend in R
问题 I want to have three curves on the same plot with different parameter alpha. curve(sin(x), from = 1, to = 3, lty = 1, ylim = c(-1, 1)) curve(sin(2 * x), add = TRUE, lty = 2) curve(sin(3 * x), add = TRUE, lty = 3) legend("topright", legend = expression(paste(alpha, " = ", c(1, 2, 3))), lty = 1:3) In the legend, I want to have three lines with alplha = 1, alpha = 2, alpha = 3. How do I make it correct? 回答1: The better, looped answer comes from here and user20650. Solution with sapply The