How to use several equal signs in text(x,y,expression(…))

若如初见. 提交于 2019-12-09 09:06:53

问题


is there a solution to use more than one equals signs in a expression (which are not within brackets)? I'm currently doing it with " = ". But thats not so nice, since == and " = " look different on the plot.

Minimal sample:

plot(0:5,0:5, type="n")
saleprice <- 35
revenue <- 98000
text(1, 2, 
     bquote(paste(R(x[G]) == .(saleprice)%.%x[G], " = ", .(revenue))))

See the following image for the current status: sample image

I would like to use something like:

bquote(R(x[G]) == .(saleprice)%.%x[G] == .(revenue))

But it produces errors.


回答1:


Use {} to put an invisible grouping around the first equality.

text(1, 2, bquote({R(x[G]) == .(saleprice)%.%x[G]} == .(revenue)))


来源:https://stackoverflow.com/questions/16919251/how-to-use-several-equal-signs-in-textx-y-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!