Closed aghaynes closed 5 years ago
Awesome! Could you add some examples, preferably somewhere in the vignette? Using expressions isn't that straightforward to most.
Also I tried to run the following:
boxGrob(expression(plain(sin) * phi, " and ", plain(cos) * phi),
width=.8, height=.8,
x=0, y=0,
bjust = c(0,0),
txt_gp = gpar(col="darkblue", cex=2),
box_gp = gpar(fill="lightyellow", col="darkblue"))
and it would only print the first section of the expression - this seems built-in to the underlying grid.text
but it's a little annoying...
Sorry, found it, all it needed was some paste:
boxGrob(expression(paste(plain(sin) * phi, " and ",
plain(cos) * phi)),
width=.8, height=.8,
x=0, y=0,
bjust = c(0,0),
txt_gp = gpar(col="darkblue", cex=2),
box_gp = gpar(fill="lightyellow", col="darkblue"))
Still, we need to add some guidance to to the end-user. Do you mind doing that?
Done! :)
Thanks!
add expression as allowable label class. textGrob supports expressions, which in turn support bold/italics and all sorts of other wonderful things.