I want to use plotmath symbols in R to add an interval to the X axis of a plot, such as 3<=X<=4
. I know you can do something like:
x=1:10
x1=3
x2=4
plot(x, xlab=substitute(a <= X *""~ X <= b, list(a=x1,b=x2)))
But I cannot remove the second X
as it will give me an error. Is this even possible? Or should I do some trick?
Try the following:
plot(x, xlab=substitute(a <= ~X <= b, list(a=x1, b=x2)))