Skip to content

Controling the x or y limit

2 messages · Subhabrata, Dimitris Rizopoulos

#
Hello - R-experts,

This may sound simple to many --- 
We can specify the x limit by saying xlim = c(0, 20) for example.
 Then the graph will show the range of x -axis between 0 - 20.
 But the coordinate gap will be automatic like 0 then 5 then 15 and 20. 
 Is there any way by which we can set it in a gap of 2 or any number.

 Thank you for any help.
 
 With Regards

 Subhabrata
#
try the following:

plot(0:20, axes = FALSE)
axis(2)
axis(1, at = seq(0, 20, 2), labels = seq(0, 20, 2))


I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://www.med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Subhabrata" <subhabratapal at sraindia.com>
To: "r-help" <r-help at stat.math.ethz.ch>
Cc: <mansur at sraindia.com>
Sent: Friday, February 10, 2006 7:04 AM
Subject: [R] Fw: Controling the x or y limit
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm