最近我开始使用cowplot
图书馆。我是情节框架的忠实粉丝,但似乎cowplot
不允许这样做。任何人都知道在情节中创建框架的技巧cowplot
吗?
library(ggplot2)
library(cowplot)
A <- c(rep(1, times = 3), rep(2, times = 3))
B0 <- c(rep("Text1", times = 3), rep("Text2", times = 3))
B <- factor(B0)
C <- c(0.25, 0.50, 0.75, 8.40, 9.00, 9.60)
D <- c(-7.3, -2.17, 1.05, -3.69, -5.04, -0.746)
DF <- data.frame(A, B, C, D)
ggplot(DF, aes(x = C, y = D , colour = B)) +
geom_point() + geom_line() + facet_grid(~ B, scales = "free") +
labs(x = "Axis X", y = "Axis Y") +
guides(color = guide_legend(expression("R"[0]))) +
theme(panel.border = element_rect(size = 0.35)) #<- no frame