Bug 16948 - mathematical label on y-axis is misaligned in X11()
Summary: mathematical label on y-axis is misaligned in X11()
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Graphics (show other bugs)
Version: R 3.3.*
Hardware: ix86 (32-bit) Linux
: P5 minor
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2016-06-13 06:01 UTC by Adrian Baddeley
Modified: 2016-06-14 20:44 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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). 
Examples
         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.