[R] plotmath "overstrikes" in output on a Linux system

From: Paul Johnson <pauljohn32_at_gmail.com>
Date: Tue, 08 Apr 2008 01:48:02 -0500

I've been testing plotmath. But I'm getting some funny output one one computer. The problem is that characters are 'jumbled' and overstrike when symbols are introduced.

Sample code:

mu <- 440.0
sigma <- 12.5
myx <- seq( mu - 4*sigma, mu+ 4*sigma, length.out=500) myDensity <- dnorm(myx,mean=mu,sd=sigma)

# Here's one way to retrieve the values of mu and sigma and insert them into an expression
t1t2 <- bquote (paste("Normal(", mu== .(mu), ',', sigma== .(sigma),")") )

plot(myx, myDensity, type="l", xlab="X", ylab="Probability Density ", main=t1t2)

I have tested this code and it works on two desktop Fedora Linux 8 systems to make a nice figure, but on a Dell Laptop with Fedora Linux 8 and R 2.6.2, something funny happens: the characters "overstrike" each other. The Greek letter "mu" is printed several spaces to the left of the "(" that it is supposed to follow. I made an itty bitty picture of the figure title to show you:


I can force in spaces to re-arrange the symbols so they do not overstrike. The following looks fine in the output.

t1t2 <- bquote (paste("Normal ( ", mu== .(mu), ' , ', sigma== .(sigma)," )") )
### Note spaces manually inserted above are needed, otherwise plotmath overlaps "l" of

plot(myx, myDensity, type="l", xlab="X", ylab="Probability Density ", main=t1t2)

What do you suppose is wrong? The X configuration?

Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 08 Apr 2008 - 06:56:16 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 08 Apr 2008 - 10:30:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive