MichaelChirico / r-bugs

A ⚠️read-only⚠️mirror of https://bugs.r-project.org/
20 stars 0 forks source link

[BUGZILLA #16948] mathematical label on y-axis is misaligned in X11() #6260

Open MichaelChirico opened 4 years ago

MichaelChirico commented 4 years ago

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()


METADATA

MichaelChirico commented 4 years ago

I can confirm this on OSX. Looks like a top-right/bottom-left confusion with rotated character glyphs.


METADATA

MichaelChirico commented 4 years ago

Happens in X11(type="Xlib") but not in X11(type="cairo")


METADATA

MichaelChirico commented 4 years ago

This was a missing set of parentheses in XRotPaintAlignedString() in src/modules/X11/rotated.c

Just running some checks before committing the fix.


METADATA