简体   繁体   中英

R expression of the form 0 < \alpha < 1

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

Wrap the second comparison in curly braces:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM