Quantcast

Remove top/right border from lattice plots

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Remove top/right border from lattice plots

Jon Zadra-2
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
[hidden email]

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Remove top/right border from lattice plots

ilai-2
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 <[hidden email]> 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
> [hidden email]
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Loading...