Bug 16948

Summary: mathematical label on y-axis is misaligned in X11()
Product: R Reporter: Adrian Baddeley <Adrian.Baddeley>
Component: GraphicsAssignee: R-core <R-core>
Status: NEW ---    
Severity: minor CC: paul, pd.mes
Priority: P5    
Version: R 3.3.*   
Hardware: ix86 (32-bit)   
OS: Linux   

Description Adrian Baddeley 2016-06-13 06:01:55 UTC
In base graphics plot.default(), title() with the default X11() driver,
if the y-axis label 'ylab' is a mathematical expression, the components of the expression are misaligned (incorrect x coordinates). 
         plot(1:2, xlab=expression(f(x)), ylab=expression(g(x)))
         plot(1:2, xlab=expression(x == f(n)), ylab=expression(y == g(n)))

Does not occur in pdf() or postscript(), only in X11()
Comment 1 Peter Dalgaard 2016-06-13 09:32:27 UTC
I can confirm this on OSX. Looks like a top-right/bottom-left confusion with rotated character glyphs.
Comment 2 Adrian Baddeley 2016-06-14 00:50:26 UTC
Happens in X11(type="Xlib") but not in X11(type="cairo")
Comment 3 Paul Murrell 2016-06-14 20:44:18 UTC
This was a missing set of parentheses in XRotPaintAlignedString() in src/modules/X11/rotated.c

Just running some checks before committing the fix.