I'd like to add multiple text labels to a plot that consist of an expression, that produces an italicised character, and a vector of values (stored in a data frame).
I can make this work with only one value using (for example) the following code:
plot.new()
axis(1)
axis(2)
text( c(0.5, 0.5), c(0.8, 0.4),
expression(paste(italic(P),"-trend =", 0.01)) )
However, I can't manage to make this work when replacing 0.01 with a vector of values. For example, the following
plot.new()
axis(1)
axis(2)
text( c(0.5, 0.5), c(0.8, 0.4),
expression(paste(italic(P),"-trend =", c(0.01, 0.001))) )
does not give the correct vector of labels but this:
Since the vector is inside expression()
. How could I make this work? I'm not knowledgeable in this particular area and perhaps I've missed a more obvious way of doing it.
A similar question was posted here but I can't manage to extrapolate it to my case.