R:莱迪思图形标题

时间:2011-02-24 10:07:26

标签: r lattice

我想在莱迪思中自定义标题...特别是对于splom,我想在图形底部删除标题“Scatterplot matrix ...”。

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 )
    },
)

提前致谢,

P上。

1 个答案:

答案 0 :(得分:2)

这样的东西?

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 = ""
)