我用双下标绘制变量,我希望能够让下标在facet strip文本中保持一致。每个标签应显示类似$ \ beta_ {1,12} $而不是$ \ beta_112 $。它应该足以修复以下MWE。
d = data.frame(
x = rnorm(6),
y = rnorm(6),
z = rep(paste0("beta[", 1:3, "][", 12, "]"), each = 2))
library(ggplot2)
pl = ggplot(d) +
geom_point(aes(x, y)) +
facet_wrap(~z, labeller = label_parsed)