R expression of the form 0 < \alpha < 1

498 views Asked by At

I want to have a legend in an R plot involving expressions. I did

legend(
  x = "topright",
  legend = c(expression(alpha == 0), expression(0 < alpha))
)

This works just fine. But if I replace the 0 < alpha by 0 < alpha < 1 I get an error. Can someone tell me how to get an expression of the form 0 < \alpha < 1? I didn't find it in the web.

Thanks a lot! Maik

1

There are 1 answers

0
Hong Ooi On BEST ANSWER

Wrap the second comparison in curly braces:

legend(
  x = "topright",
  legend = c(expression(alpha == 0), expression(0 < {alpha < 1}))
)