我已经用我的数据和库的bwplot
功能做了一个条件箱线图lattice
。
A1 <- bwplot(measure ~ month | plot , data = prueba,
strip = strip.custom(bg = 'white'),
cex = .8, layout = c(2, 2),
xlab = "Month", ylab = "Total",
par.settings = list(
box.rectangle = list(col = 1),
box.umbrella = list(col = 1),
plot.symbol = list(cex = .8, col = 1)),
scales = list(x = list(relation = "same"),
y = list(relation = "same")))
然后,我做了一个 xyplot,因为我想将降水数据添加到上一个图表中,也使用xyplot
from lattice
library。
B1 <- xyplot(precip ~ month | plot, data=prueba,
type="b",
ylab = '% precip',
xlab = 'month',
strip = function(bg = 'white', ...)
strip.default(bg = 'white', ...),
scales = list(alternating = F,
x=list(relation = 'same'),
y=list(relation = 'same')))
我尝试使用grid.arrange
来自gridExtra
库的同一图表上绘制它们:
grid.arrange(A1,B1)
但是有了这个,我不重叠数据,但结果是这样的
我怎样才能在由情节决定的箱线图“内部”绘制降水数据?
谢谢