1

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?

plannapus
  • 18,529
  • 4
  • 72
  • 94
jcredberry
  • 97
  • 7

1 Answers1

1

Try the following:

plot(x, xlab=substitute(a <= ~X <= b, list(a=x1, b=x2)))
rcs
  • 67,191
  • 22
  • 172
  • 153