Re: [R] Axis/Ticks/Scale

From: P Ehlers <ehlers_at_math.ucalgary.ca>
Date: Thu 29 Dec 2005 - 08:38:43 EST

Try this:

x <- c(1, 1e6); y <- 0:1
par(mar = c(5, 4, 4, 5) + 0.1) # make room at the right plot(x, y, axes = FALSE)
box()
axis(2)
axis(1, at = 0:5 * 2 * 1e5, labels = 0:5 * 2) mtext(text = expression(phantom(0)%*%10^5),

       side = 1, line = 1, at = 11.0 * 1e5)

Peter Ehlers

R.C.GILL@soton.ac.uk wrote:
> Dear All,
>
> Apologies for this simple question and thanks in advance for any help given.
>
> Suppose I wanted to plot 1 million observations and produce the command
>
> plot(rnorm(1000000))
>
> The labels of the xaxis are 0, e+00 2 e+05 etc. These are clearly not very
> attractive (The plots are for a PhD. thesis).
>
> I would like the axes to be 0,2,4,6,8,10 with a *10^5 on the right hand
> side.
>
> Is there a simple command for this?
>
> Best Wishes
>
> Roger
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Dec 29 08:46:35 2005

This archive was generated by hypermail 2.1.8 : Thu 29 Dec 2005 - 09:39:03 EST