Re: [R] How to set the scale of axis?

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Fri 06 Apr 2007 - 10:59:33 GMT

Try this:

plot(1:100, xaxt = "n")
axis(1, c(1, 20, 40, 60, 80, 100))

# and optionally add this third line
axis(1, 1:100, FALSE, tcl = -0.3)

See ?par (for the xaxt argument to plot) and ?axis . ?plot and ?plot.default have info on the plot command. A good source of sample code for graphics is:

  http://addictedtor.free.fr/graphiques/

On 4/6/07, Shao <xshining@gmail.com> wrote:
> Hello,everyone.
>
> I want to know how to control the scale of axises.
>
> For example, the range of x axis is (1,100),and I want to show the scale in
> the axis as this:
> 1 20 40 60 80 100.
>
> Is there any parameters in plot() or other functions to set the scale?
>
> Thands!
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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
> and provide commented, minimal, self-contained, reproducible code.
>



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 and provide commented, minimal, self-contained, reproducible code. Received on Fri Apr 06 21:12:55 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 06 Apr 2007 - 12:31:29 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.