【发布时间】:2016-03-14 20:26:05
【问题描述】:
我有两个因素的组合图。由于我使用的是双 Y 刻度,我不能轻易使用 ggplot2,所以我使用 {lattice}。
当我将条带应用到边缘时(通过 useOuterStrips),我的 Y 刻度与带有因子名称的条带重叠。如何避免重叠?还有一种方法可以将左侧的 var2 条切换到绘图的右侧吗?
我的虚拟数据:
mtcars$HP <- equal.count(mtcars$hp)
a<-useOuterStrips(xyplot(mpg ~ disp | factor(cyl) + HP, mtcars),
strip.left = TRUE,
strip = strip.custom(style = 4),)
b<-useOuterStrips(xyplot(qsec ~ disp | factor(cyl) + HP, mtcars),
strip.left = TRUE,
strip = strip.custom(style = 4),)
doubleYScale(a,b, add.ylab2=TRUE)
【问题讨论】: