Skip to content

text(): combine expression and line break

3 messages · Johannes Radinger, jim holtman, Bert Gunter

#
try this:


plot(1,type="n", xaxt='n', yaxt='n', ann=FALSE)
text(1,1,labels=expression(atop(sigma, "log scale,m")),cex = 2)
On Fri, May 11, 2012 at 1:40 PM, Johannes Radinger <jradinger at gmx.at> wrote:

  
    
#
Try this:
 plot(1,type="n", xaxt='n', yaxt='n', ann=FALSE)
 text(1,1,labels=expression(atop(sigma,"(log scale, m)")),cex = 2)

You can add extra blank characters to align the text like this:

 plot(1,type="n", xaxt='n', yaxt='n', ann=FALSE)
text(1,1,labels=expression(atop(sigma,phantom("WWWWW")~"(log scale,
m)")),cex = 2)

I would not be surprised if there are more elegant ways to do it, though.

Cheers,
Bert
On Fri, May 11, 2012 at 10:40 AM, Johannes Radinger <jradinger at gmx.at> wrote: