一些数据:
dummy.dt <- data.frame(c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1000))
plot(dummy.dt, type="n", xlab="x" , ylab="y", xaxt = "n", log = "y")
ABC = 1
XYZ = 2
rp = vector('expression',2)
rp[1] = substitute(expression(italic(A) == MYVALUE),
list(MYVALUE = format(ABC, digits = 3)))[2]
rp[2] = substitute(expression(italic(X) == MYOTHERVALUE),
list(MYOTHERVALUE = format(XYZ, digits = 3)))[2]
legend('top', legend = rp ,bty = 'n')
最后一节取自此处
如何将图例中的两个表达式用不同的颜色着色?