[R] How to set the scale of axis?

Gabor Grothendieck ggrothendieck at gmail.com
Fri Apr 6 12:59:33 CEST 2007


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 at 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 at 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.
>



More information about the R-help mailing list