1

recently I started to use cowplot library. I'm a huge fan of the plot frames, however it seems that cowplot doesn't allow it. Anyone knows a trick to create a frame in plots with 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

enter image description here

enter image description here

Daniel Valencia C.
  • 2,159
  • 2
  • 19
  • 38

0 Answers0