[R] Remove top/right border from lattice plots

219 views
Skip to first unread message

Jon Zadra

unread,
Apr 24, 2012, 2:10:10 PM4/24/12
to r-h...@r-project.org
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
za...@virginia.edu

[[alternative HTML version deleted]]

______________________________________________
R-h...@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.

ilai

unread,
Apr 24, 2012, 5:10:04 PM4/24/12
to Jon Zadra, r-h...@r-project.org
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
Reply all
Reply to author
Forward
0 new messages