[R] how to draw x-axis at randomly position

Liaw, Andy andy_liaw at merck.com
Wed Mar 8 17:39:57 CET 2006


Try something like:

plot(1:5, xaxt="n")
axis(side=1, pos=3)

When all else fails, read the help pages (again)...

Andy

From: Jing Yang
> 
> Dear R-user,
> 
> Does any of you know how to draw x-axis at randomly position? 
> It looks I could only draw x-axis at the bottom and top of 
> the plot area (by using function axis). 
> However, sometimes I need to draw x-axis at randomly 
> position, for example, in the plot of y~x, I'd like to let 
> the x-axis go cross y=5.
> 
> Best,Jing
> 
>




More information about the R-help mailing list