[R] Remove top/right border from lattice plots

ilai keren at math.montana.edu
Tue Apr 24 23:10:04 CEST 2012


You need to do a little more work to add the components you want "back
in". I think you want something like:

 xyplot( Sepal.Length ~ Petal.Length, auto.key=T, data=iris,
  par.settings = list(axis.line = list(col = 0)),scales=list(col=1,tck=c(1,0)),
 panel=function(...){
 lims <- current.panel.limits()
 panel.xyplot(...)
 panel.abline(h=lims$ylim[1],v=lims$xlim[1])
 })

HTH

On Tue, Apr 24, 2012 at 12:10 PM, Jon Zadra <jrz9f at virginia.edu> wrote:
> Hi,
>
> I've done my best to search for a solution to this, but had no luck.
> How can I create a lattice plot (I'm using xyplot() ) that does not have
> a border on the top and right side, but keeps the bottom/left axes?
>
> So far all I've found is this, which inserted into the xyplot call
> removes all 4 borders:
>
> /  par.settings = list(axis.line = list(col = 0))/
>
> xyplot( Sepal.Length ~ Petal.Length, auto.key=T, data=iris, par.settings
> = list(axis.line = list(col = 0)))
>
> Thanks in advance,
>
> - Jon
> /
>
> /
>
> --
> Jon Zadra
> Department of Psychology
> University of Virginia
> P.O. Box 400400
> Charlottesville VA 22904
> (434) 982-4744
> zadra at virginia.edu
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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