如何在 lattice xyplot 中隐藏 x 轴(xlim )?正常情况下,这可以通过以下代码实现:
全局隐藏也可以在上面的
hist(rnorm(10,0,2), axes=F)
如果您有很多图形需要处理,那么全局解决方案会非常好。我正在使用gridExtra包:
grid.arrange(plot1,plot2,plot3, ncol=3)
例如,这允许隐藏xlab、ylab和main
。
pl = list(plot1,plot2,plot3)
do.call(grid.arrange, lapply(pl, update, xlab="", ylab="", main=""))
以下是示例数据:
Data <- data.frame(x=rnorm(10,2,2),y=rnorm(10,3,3),z=rexp(10,2))
plot1 <- xyplot(x~y, Data, xlab="name", ylab="name", main="title")
plot2 <- xyplot(z~y, Data, xlab="name", ylab="name", main="title")
plot3 <- xyplot(z~x, Data, xlab="name", ylab="name", main="title")
全局隐藏也可以在上面的
print()
中显示,或者其他所有这些内容都有帮助。
scales = list(relation = "free", y = list(draw = FALSE))
。 - Waldir Leoncio