R: Lattice graphics titles
I want to customize titles in Lattice... Especially for splom I want to remove the title "Scatte开发者_StackOverflow社区rplot matrix..." at bottom of the graphics.
splom(
iris[,1:4],
upper.panel = function(x, y, ...) {
panel.xyplot( x, y )
l <- lm(y~x)
panel.xyplot( x,fitted(l), type="l" )
l <- lowess(x,y)
panel.xyplot( l$x, l$y, col="red", type="l" )
panel.xyplot(x, y )
},
lower.panel = function(x, y, ...) {
x1 <- range(x,na.rm=T)
y1 <- range(y,na.rm=T)
panel.text( min(x1)+(max(x1)-min(x1))/2, min(y1)+(max(y1)-min(y1))/2, labels=round(cor(x,y),3), cex=2 )
},
)
Thanks in advance,
P.
Something like this?
splom(
iris[,1:4],
upper.panel = function(x, y, ...) {
panel.xyplot( x, y )
l <- lm(y~x)
panel.xyplot( x,fitted(l), type="l" )
l <- lowess(x,y)
panel.xyplot( l$x, l$y, col="red", type="l" )
panel.xyplot(x, y )
},
lower.panel = function(x, y, ...) {
x1 <- range(x,na.rm=T)
y1 <- range(y,na.rm=T)
panel.text( min(x1)+(max(x1)-min(x1))/2, min(y1)+(max(y1)-min(y1))/2, labels=round(cor(x,y),3), cex=2 )
}, xlab = ""
)
精彩评论