I am unable to modify the x axis labels on the second facet. The ones for the first facet are fine but how to make the ones for the second facet to be - 119
, 121
, 130
, 133
?
Here is my code:
data$treatment <- factor(data$treatment, levels = c("baseline", "3m"))
labels<- c(`baseline` = "Baseline",`3m` = "3 m after")
p <- ggplot(data = data, aes(x = day, y = BL.P, group = mechanism)) +
geom_line(aes(color = mechanism), size = 1) +
geom_point(aes(color = mechanism), size = 3) +
scale_color_manual(values = c("#CC79A7", "#0072B2", "#000000"),
name = "Mechanism") +
labs(title = "Title", x = "Day", y = "Proportion (%)") +
p + facet_grid(~treatment, scales = "free_x", space = "free_x",
labeller = labeller(treatment = labels)) +
scale_x_continuous(breaks = seq(1,21,by = 1),
labels = c("1","3","5","8","10","15","17","19","22","24",
"26","29","31","33","36","38","40","43","45",
"47","50")) +
theme(strip.text.x = element_text(size = 12, face = "bold"))
Here is my data: https://www.dropbox.com/s/kppvgucdwa20otd/data.csv?dl=0
I am a complete R beginner and this is one of my first figures. I would very much appreciate a simple solution if possible...