【问题标题】:Make panels fill screen in lattice?使面板以格子形式填充屏幕?
【发布时间】:2014-03-26 09:03:33
【问题描述】:

我正在绘制来自 nlme 的一些分组数据,我有 120 个面板。默认绘图plot(dataG) 将它们放在 2 行 60 列中,这会填满整个屏幕,但很难阅读。当我指定布局plot(dataG), layout= c(12,10)) 时,我得到了正确的行数和列数,但是这些列都被挤在一起了。

我不确定问题是不是因为一切都在 nlme 内部发生,但我在我的 nlme 书中没有找到解决方案。

你可以在这里找到数据

https://www.dropbox.com/s/79tssi252ai0ez8/COBS%20Roots%202008-2013noCNfake08.txt

以及定义分组的代码:

roots<-read.table("COBS Roots 2008-2013noCNfake08.txt", header = TRUE)
library(nlme)
roots$EU<- with(roots, factor(plot):factor(depth))
rootsG<-groupedData(mass ~ year | EU, data=roots)

plot(rootsG, layout = c(12, 10))

【问题讨论】:

  • 您反对在lattice 包中使用xyplot 吗?我能够生产出接近您想要的东西。
  • 我不反对,尤其是如果它可以处理分组数据。我只是在nlme 之外没有任何lattice 经验。
  • lattice 非常适合分组数据。我在下面添加了一个答案。

标签: r lattice nlme trellis


【解决方案1】:

我能够使用lattice 包生成一个 12 x 10 的面板图。希望它能让你朝着正确的方向前进。

> roots <-read.table("COBS Roots 2008-2013noCNfake08.txt", header = TRUE)
> roots$EU <- with(roots, factor(plot):factor(depth))
> library(lattice)
> xyplot(mass ~ year | EU, data = roots, layout = c(12,10))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-15
    • 2015-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多