我们可以在rasterVis::levelplot
条形标签中包含下标/上标字符吗?
考虑以下RasterStack
, s
:
library(rasterVis)
s <- stack(replicate(2, raster(matrix(runif(9), 3))))
对象的默认绘图方法Raster*
允许将表达式传递给main
参数:
plot(s, main=expression(Something, Something[2]))
With rasterVis::levelplot
,strip 名称是通过names.attr
参数传递的,但似乎这些character
在最终被传递给之前被强制传递给lattice::levelplot
with strip.custom(factor.levels = names.attr)
。
结果是:
levelplot(s, names.attr=expression(Something, Something[2]))
除了修改源代码之外,有没有办法在带状标签中使用表达式(或以其他方式实现下标/上标字符)rasterVis::levelplot
?