library(dplyr)
library(tidyr)
library(ggplot2)
dummy.data <- data.frame(
X1 = c(1,2,-1,0),
X2 = c(2,3,-2,-1),
Month = c("January", "June", "January", "June"),
Colour = c("A", "B", "B", "A")
) %>%
gather(key, value, X1:X2)
ggplot(dummy.data) +
geom_line(aes(x = Month, y = value, colour = Colour, group = Colour)) +
facet_grid(~variable)
I would like to have January at the left edge of each panel; June at the right edge. There should be no grey band between the endpoints of the coloured lines and the edges of the panel.