如何将灰色小平面标签(A和B)更改为带有白色文本的红色背景?
A = data.table(x = 1:4, y = 1:4, z = c('A','A','B','B')) ggplot(A) + geom_point(aes(x = x, y = y)) + facet_wrap(~z) + theme_bw()
你可以做:
ggplot(A) + geom_point(aes(x = x, y = y)) + facet_wrap(~z) + theme_bw()+ theme(strip.background =element_rect(fill="red"))+ theme(strip.text = element_text(colour = 'white'))