[R] plotmath "overstrikes" in output on a Linux system
Paul Johnson
pauljohn32 at gmail.com
Tue Apr 8 08:48:02 CEST 2008
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:
http://pj.freefaculty.org/R/plotmath_problem.png
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
More information about the R-help
mailing list