【发布时间】:2014-08-04 08:43:57
【问题描述】:
我使用bwplot 库的bwplot 函数对我的数据进行了条件箱线图。
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,因为我想将降水数据添加到上一个图表中,同时使用来自 lattice 库的 xyplot。
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')))
我尝试使用来自gridExtra 库的grid.arrange 将它们绘制在同一张图上:
grid.arrange(A1,B1)
但是有了这个,我没有重叠数据,但是结果是这样的
如何在由 plot 条件的箱线图“内部”绘制降水数据?
谢谢
【问题讨论】: