如何在晶格R中隐藏x轴 [英] How to hide x-axis in lattice R

查看:61
本文介绍了如何在晶格R中隐藏x轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在晶格xyplot中隐藏x轴(xlim?)?

How to hide x-axis (xlim?) in lattice xyplot?

通常情节是:

hist(rnorm(10,0,2), axes=F)

由于我的情节很少,因此全局解决方案也将是一个很好的解决方案.我正在使用gridExtra包:

And also global solution would be great, since I have quite few plots. I'm using the gridExtra package:

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()上,否则这将有所帮助.

Hiding globally can be also shown on print() on the above or else all this helps.

推荐答案

尝试一下

xyplot(1:10~1:10, scales=list(x=list(at=NULL)))

您应该阅读?xyplot

这篇关于如何在晶格R中隐藏x轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆