[R] plot only x- and y-axis with origin, no box()

Greg Snow Greg.Snow at intermountainmail.org
Tue Jun 19 18:22:54 CEST 2007


Try:

> plot(.., bty='l')

Does that do what you want?  (see the bty parameter in ?par for details)

If you don't want the lines extending beyond the axes on the right and
top then you could do something more like:

> plot(5:10, 5:10, bty='n')
> library(TeachingDemos)
> lines(cnvrt.coords( c(0,0,.5), c(.5,0,0), input='plt')$usr)

You may also get what you want by playing with the xaxp and yaxp
parameters to par, but the bty='l' seems the easiest way to go. 

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111
 
 

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of 
> Talloen, Willem [PRDBE]
> Sent: Tuesday, June 19, 2007 7:15 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] plot only x- and y-axis with origin, no box()
> 
> hi all,
> 
> I'm trying for quite some time to have an x- and y-axis, but 
> no entire box.
> 
> >plot(..,axes=F)
> >axis(1)
> >axis(2)
> Gives this, but their axes do not go to the origin.
> Quite a number of people find this gap between the two axes 
> disturbing.
> Has anyone an idea how to let these axes go to the origin?
> 
> thank you in advance
> 
> 	[[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
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list