Bug 14477 - plotmath format affected by earlier format call
Summary: plotmath format affected by earlier format call
Alias: None
Product: R
Classification: Unclassified
Component: Graphics (show other bugs)
Version: R-devel (trunk)
Hardware: All All
: P5 minor
Assignee: R-core
Depends on:
Reported: 2011-01-18 14:23 UTC by Duncan Murdoch
Modified: 2011-01-18 17:09 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Murdoch 2011-01-18 14:23:53 UTC
Philip Johnson reported on R-devel:

I have run into a potential bug somewhere between format (specifically 
scientific notation) and plotmath that results in displaying:
instead of

Reproduce by:
	a=format(10, scientific=TRUE)
	mtext(expression(10^2), line=1) # looks like $1e+01^{2e+00}$
	10 # this fixes the problem on the next line
	mtext(expression(10^2), line=2) # looks like $10^2$

I can narrow the trigger somewhat further by replacing the "a=..." line 
	a=.Internal(format(10, FALSE, NULL, 0L, NULL, 3L, TRUE, TRUE))
Tracing this call into the C started giving me a headache, so I'm hoping 
that one of the R core gurus can confirm & file a bug report if necessary.

I ran into this on Ubuntu / Lucid using R version 2.10.1 (2009-12-14).
I confirmed it still exists in R 2.12.1 (2010-12-16) on a fresh install 
of Ubuntu / Maverick.


I confirmed the bug in R-devel on Win32, so I don't think it's platform related.
Comment 1 Brian Ripley 2011-01-18 17:09:11 UTC
There was a call to PrintDefaults() missing in plotmath.

Fixed in 2.12.1 patched.