On 08/11/2010 06:18 AM, Watkins, Janice wrote:
The labels on the x-axis are defaulting to scientific notation no matter
how small cex.axis is. How can I override scientific notation to get the
labels to print out as specified? Here is the code (UNIT here is
0.0105):

plot(xm,yv,log="xy",ylim=c(0.1,20)/UNIT,xlim=c(0.004,20)*UNIT,xaxt="n",t
ype="n")

axis(1, at=c(0.0001,0.001,0.005,0.01,0.05,0.5,0.1,1),cex.axis=0.7)


Hi Janice,
Have a look at the "scipen" option. This forces output format toward either fixed or exponential notation depending on the value. Roughly, if scipen is set to zero (the default), the output format will be whichever had the fewest characters. If you set it to a positive number:

options(scipen=3)

you will probably get the fixed notation in your plot, as the exponential notation will always be longer. To go the other way, set scipen to a negative number.

Jim

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to