开发者

R: Lattice graphics titles

开发者 https://www.devze.com 2023-02-13 07:34 出处:网络
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.

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

精彩评论

暂无评论...
验证码 换一张
取 消