Skip to content

Align expression and text in mtext()

2 messages · Remko Duursma, David Winsemius

#
Dear R-helpers,


I have trouble aligning an expression with a subscript, and text, in margin
text:

par(mar=c(6,6,1,1))
b <- barplot(1:3)
mtext(c("A","B","C"), at=b, side=1, line=1, cex=1.3) 
mtext(expression(italic(C)[a]~(more~text)), at=0, line=1, side=1,cex=1.3)


As explained in the help files and elsewhere, I understand that the
expression is aligned by the bounding box, not the lower end of the 'text'
in the expression. Playing with adj or padj in mtext() does not really solve
this?

Any suggestions or workarounds?

PS, I tried using a phantom() expression for the text bits; but this messes
up the horizontal alignment).


thanks,
Remko



--
View this message in context: http://r.789695.n4.nabble.com/Align-expression-and-text-in-mtext-tp4175286p4175286.html
Sent from the R help mailing list archive at Nabble.com.
#
On Dec 8, 2011, at 9:53 PM, Remko Duursma wrote:

            
I couldn't understand from your statement what you were "having  
trouble" with achieving, and even after running your example I am  
still not clear. If your goal is to get the bottom the the expression  
lined up with the bottom of the axis labels inserted with mtext then  
try padj=.2