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

From: Greg Snow <Greg.Snow_at_intermountainmail.org>
Date: Tue, 19 Jun 2007 10:22:54 -0600

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.
> ______________________________________________ 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.
Received on Tue 19 Jun 2007 - 16:34:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 20 Jun 2007 - 07:32:38 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.