Skip to content
Prev 26294 / 398502 Next

axis

Myriam Abramson wrote:
Yes, using axis() with argument "pos", see ?axis. 

Example:

 y <- rnorm(21)
 plot(-10:10, y, axes=FALSE)
 axis(1, pos=0)
 axis(2, pos=0)

 # OK. Looks ugly (the zero). Next try:
 plot(-10:10, y, axes=FALSE) 
 axis(1, pos = 0, at = c(-10, -5, 5, 10))
 yprt <- pretty(y)
 yprt <- yprt[yprt != 0]
 axis(2, pos = 0, at = yprt)


Uwe Ligges