[R] how to ajust y-axis values in plot() ?

Rui Barradas ruipbarradas at sapo.pt
Tue Oct 14 13:45:17 CEST 2014


Hello,

Use the argument ylim. See ?par instead of plot.

plot(11:20, ylim = c(0, 40))
abline(h=40)

Hope this helps,

Rui Barradas


Em 14-10-2014 10:33, PO SU escreveu:
>
> Dear helpeRs,
>    I want to plot( 11:20 ) in a plot.
>   if i just type the code above, the y value  will be from 11 to 20, now i want the value from a given range like  0 to 40, how can i do it?
> I read ?plot  for a while but  still can't solve it.
> Actually, the qustion is founded when i already plot a plot like plot(11:20) , but when i abline(h=40), i found it will go out of the plot even after i used abline(h=40,xpd=T).
> SO, may you help me?
>
>
>
>
>
> --
>
> PO SU
> mail: desolator88 at 163.com
> Majored in Statistics from SJTU
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list