I am trying to eliminate panel borders from my
lattice plots. By default, they always print. For
example:
library(lattice)
x <- seq(-3,3,length=1000)
y1 <- dnorm(x)
y2 <- dnorm(x, sd=.5)
data <- data.frame(x=rep(x,2), y=c(y,y2),
panel=rep(c(1,2), each=1000))
dplot <- xyplot(y~x | panel, data=data, strip=F,
scales=list(draw=F))
print(dplot, scales=list(draw=F))
prints borders around each panel. I see no way to
get rid of them short of creating a panel function
and "painting over" these default borders with
grid.rect(). But I suspect that there is an easier
way -- is there?
I searched the archives but saw nothing on this.
I'm running R 2.3.1 with lattice 0.13.
Thank you,
--John
eliminating panel borders from lattice plots
3 messages · John Bullock, Gabor Grothendieck
Try adding this argument to your xyplot call: par.settings = list(axis.line = list(col = 0)) The subparameters oif axis.line are: trellis.par.get()$axis.line in case you want to temporarily set others.
On 3/25/07, John Bullock <john.bullock at stanford.edu> wrote:
I am trying to eliminate panel borders from my
lattice plots. By default, they always print. For
example:
library(lattice)
x <- seq(-3,3,length=1000)
y1 <- dnorm(x)
y2 <- dnorm(x, sd=.5)
data <- data.frame(x=rep(x,2), y=c(y,y2),
panel=rep(c(1,2), each=1000))
dplot <- xyplot(y~x | panel, data=data, strip=F,
scales=list(draw=F))
print(dplot, scales=list(draw=F))
prints borders around each panel. I see no way to
get rid of them short of creating a panel function
and "painting over" these default borders with
grid.rect(). But I suspect that there is an easier
way -- is there?
I searched the archives but saw nothing on this.
I'm running R 2.3.1 with lattice 0.13.
Thank you,
--John
______________________________________________ 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.
2 days later
On 3/25/07, John Bullock <john.bullock at stanford.edu> wrote:
I am trying to eliminate panel borders from my
lattice plots. By default, they always print.
For
example:
library(lattice)
x <- seq(-3,3,length=1000)
y1 <- dnorm(x)
y2 <- dnorm(x, sd=.5)
data <- data.frame(x=rep(x,2), y=c(y,y2),
panel=rep(c(1,2), each=1000))
dplot <- xyplot(y~x | panel, data=data,
strip=F,
scales=list(draw=F))
print(dplot, scales=list(draw=F))
prints borders around each panel. I see no way
to get rid of them short of creating a panel
function and "painting over" these default
borders with grid.rect(). But I suspect that
there is an easier way -- is there?
I searched the archives but saw nothing on this.
I'm running R 2.3.1 with lattice 0.13.
Thank you,
--John
----- Original Message ----- From: "Gabor Grothendieck" <ggrothendieck at gmail.com> To: "John Bullock" <john.bullock at stanford.edu> Cc: <r-help at stat.math.ethz.ch> Sent: Sunday, March 25, 2007 6:07 AM Subject: Re: [R] eliminating panel borders from lattice plots
Try adding this argument to your xyplot call: par.settings = list(axis.line = list(col = 0)) The subparameters oif axis.line are: trellis.par.get()$axis.line in case you want to temporarily set others.
Thank you. That worked beautifully.