0

Similar to this thread, but this time I need double.

Here is an example:

x1 <- 0
x2 <- 1
plot(c(0,1),c(0,0), type="l", axes=FALSE, main="", ylab="", xlab="")
axis(1, at=c(0, 1), labels=c(bquote(gamma~" = " ~ .(x1)), expression(delta~" = " ~ .(x2))), pos=-.01, xpd=TRUE)

The plot labels should should should be:

 Gamma = 0     Delta = 1

However, take a look when you run for yourself, you get:

 Gamma = 0     Delta = .(x2)    

Note the code below does not work as expected:

axis(1, at=c(0, 1), labels=c(bquote(gamma~" = " ~ .(x1)), bquote(delta~" = " ~ .(x2)), pos=-.01, xpd=TRUE)

It produces:

gamma ~ " = " ~ 0     delta ~ " = " ~ 1

Thank you.

Community
  • 1
  • 1
valuet
  • 1

1 Answers1

0

How about

axis(1, labels=eval(bquote(expression(gamma == .(x1),delta == .(x2)))),
    at=c(0, 1), pos=-.01, xpd=TRUE) 

enter image description here

MrFlick
  • 195,160
  • 17
  • 277
  • 295