Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make parentheses bigger (to fit the size of an expression inide of them) in an R plot label?

Tags:

r

For example. Consider the code

plot(rnorm(10), xlab = NA, ylab = NA)
mtext(side=1, expression( paste("Log"["10"], ( frac( "x","y") ) ))) 

I would like to make the parentheses in the expression larger, to fit the size of the expression inside them. Note the expression is actually much more complicated in my actual script, but this is a minimal reproducible example that captures the essence of the problem.

like image 554
WetlabStudent Avatar asked Jul 21 '15 04:07

WetlabStudent


1 Answers

From the demo pointed out by @Pascal, the answer is to use bgroup

mtext(side=1, expression( paste("Log"["10"], bgroup("(", frac( "x","y"), ")" ) )))
like image 101
WetlabStudent Avatar answered Oct 25 '22 09:10

WetlabStudent