Articles

Affichage des articles du août, 2017

Another example of plotmath

Image
plotmath is very powerful but also not very simple to use. See ?plotmath Here is another example of formatting: > plot(1:100,main="ABCD",cex.main=1.3) > a=100; b=10 > mtext(bquote(bold(.(formatC(1.2*a,decimal.mark=",",digits=2,format="f")))~" series "~bold(.(formatC(b, digits=0,format="f")))~" items")) > text(x=1, y=50, bquote(bold(.(formatC(1.2*a,decimal.mark=",",digits=2,format="f")))~" series "~bold(.(formatC(b, digits=0,format="f")))~" items"), pos=4) The result is: Some explanations: ~ is a linker between two objects with a space: text(x=1, y=50, bquote("a"~"b"), pos=4) * is a linker between two objects without a space: text(x=1, y=50, bquote("a"*"b"), pos=4) use \" between " to show the " character: text(x=1, y=50, bquote("\"a\""*"\"b\""), pos=4)