I have a df and I have plotted two different line charts. Unfortunately, there are a lot of dates so everything is squeezed up in the x-axis. I would like to remove the dates or leave just 4 . Can anyone help?
dput(df)
structure(list(ID = c("F1", "F1", "F1", "F1", "F1", "F1",
"F1", "F2", "F2", "F2", "F2", "F2", "F2", "F2", "F2", "F3", "F3",
"F3", "F3", "F3", "F3", "F3", "F3", "F3", "F4", "F4", "F4", "F4",
"F4", "F4", "F4", "F4"), Date = c("22/6/2021", "23/6/2021", "24/6/2021",
"25/6/2021", "26/6/2021", "27/6/2021", "28/6/2021", "22/6/2021",
"23/6/2021", "24/6/2021", "25/6/2021", "26/6/2021", "27/6/2021",
"28/6/2021", "29/6/2021", "22/6/2021", "23/6/2021", "24/6/2021",
"25/6/2021", "26/6/2021", "27/6/2021", "28/6/2021", "29/6/2021",
"30/6/2021", "22/6/2021", "23/6/2021", "24/6/2021", "25/6/2021",
"26/6/2021", "27/6/2021", "28/6/2021", "29/6/2021"), Values = c(9.6,
9.8, 10.2, 9.8, 9.9, 9.9, 9.9, 1.2, 1.2, 1.8, 1.5, 1.5, 1.6,
1.4, 1.1, 3266, 3256, 7044, 6868, 6556, 3405, 3410, 3980, 5567,
59.4, 56, 52.8, 52.4, 55.5, 54, 61, 53.6), Bin = c(0L, 0L, 1L,
0L, 1L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 1L, 1L, 1L, 0L, 0L, 0L, 1L,
1L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 0L, 0L, 0L)), class = "data.frame", row.names = c(NA,
-32L))
ggplot(data = df, aes(x = factor(Date), y = Values)) +
geom_line(aes(group = ID)) + geom_point() +
facet_wrap(~ID, scales = 'free')
ggplot(aes(x = Date, y = Values)) +
geom_line(aes(group = ID)) + geom_point(aes(color = factor(Bin) )) +
scale_x_discrete(labels="")+
facet_wrap(~ID, scales = 'free'))