R ggplot2 facet_wrap reordering subfigure and set different colors for each ID label
问题 I am trying to reorder the subfigures order in ggplot facet_wrap and specify a certain color for their subfigure text label. Here is my dataset: ID <- rep(c('ABC123','DEF456','GHI789','JKL012'),each = 10) Vref <- c((runif(10,1,2)),(runif(10,3,5)),(runif(10,6,9)),(runif(10,0,2))) Time <- rep(c(1:10),4) df <- data.frame(ID,Vref,Time) ggplot(df) + geom_point(aes(x=Time, y=Vref)) + facet_wrap(~ID, nrow = 2) Now the order of subfigure is ABC123 --> DEF456 --> GHI789 --> JKL012. All text labels are