[R] plot function

Henrik Andersson h.andersson at nioo.knaw.nl
Wed Jan 26 09:18:21 CET 2005


Try this,

plot(x,y,xlim=c(a,b),ylim=c(c,d))

lines(z,q) will only add lines onto an existing plot, not create a new plot!

Have a look at:
http://cran.r-project.org/doc/manuals/R-intro.html#Graphics

Cheers, Henrik

Cuichang Zhao wrote:
> Hello, 
> how can use change the plot function to change the range of axises. I want my graph from a certain range [a, b], instead of  from the min to max of of datas?
> if i want draw a line instead of dots, should i use both plot and lines function.
> for example:
> plot(x, y);
> lines(x, y);
>  
> things seem not working if i only use lines(x, y).
>  
> Thank you so much.
>  
> Cuichang Zhao
>  
> Jan 25, 2005
> 
> 		
> ---------------------------------
> 
> 
> 	[[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
> 


-- 
---------------------------------------------
Henrik Andersson
Netherlands Institute of Ecology -
Centre for Estuarine and Marine Ecology
P.O. Box 140
4400 AC Yerseke
Phone: +31 113 577473
h.andersson at nioo.knaw.nl
http://www.nioo.knaw.nl/ppages/handersson




More information about the R-help mailing list