I have following data. Please note that the date time values are not continuous.
DateTime value
1 X2016.08.10.00.00.00.03.00.00 0
2 X2016.08.10.03.00.00.06.00.00 1
3 X2016.08.10.06.00.00.09.00.00 17
4 X2016.08.10.09.00.00.12.00.00 28
5 X2016.08.10.12.00.00.15.00.00 22
6 X2016.08.10.15.00.00.18.00.00 31
7 X2016.08.10.18.00.00.21.00.00 16
8 X2016.08.10.21.00.00.00.00.00 4
9 X2016.08.11.00.00.00.03.00.00 0
10 X2016.08.11.03.00.00.06.00.00 4
11 X2016.08.11.06.00.00.09.00.00 23
12 X2016.08.11.09.00.00.12.00.00 22
13 X2016.08.11.12.00.00.15.00.00 24
14 X2016.08.11.15.00.00.18.00.00 30
15 X2016.08.11.18.00.00.21.00.00 15
16 X2016.08.11.21.00.00.00.00.00 5
17 X2016.08.12.00.00.00.03.00.00 0
18 X2016.08.12.03.00.00.06.00.00 3
19 X2016.08.12.06.00.00.09.00.00 26
20 X2016.08.12.09.00.00.12.00.00 20
21 X2016.08.12.12.00.00.15.00.00 17
22 X2016.08.12.15.00.00.18.00.00 34
23 X2016.08.12.18.00.00.21.00.00 19
24 X2016.08.12.21.00.00.00.00.00 5
25 X2016.08.15.00.00.00.03.00.00 0
26 X2016.08.15.03.00.00.06.00.00 4
27 X2016.08.15.06.00.00.09.00.00 24
28 X2016.08.15.09.00.00.12.00.00 16
29 X2016.08.15.12.00.00.15.00.00 31
30 X2016.08.15.15.00.00.18.00.00 26
31 X2016.08.15.18.00.00.21.00.00 24
32 X2016.08.15.21.00.00.00.00.00 16
33 X2016.08.16.00.00.00.03.00.00 0
34 X2016.08.16.03.00.00.06.00.00 4
35 X2016.08.16.06.00.00.09.00.00 18
36 X2016.08.16.09.00.00.12.00.00 26
37 X2016.08.16.12.00.00.15.00.00 27
38 X2016.08.16.15.00.00.18.00.00 26
39 X2016.08.16.18.00.00.21.00.00 26
40 X2016.08.16.21.00.00.00.00.00 9
41 X2016.08.17.00.00.00.03.00.00 0
42 X2016.08.17.03.00.00.06.00.00 2
43 X2016.08.17.06.00.00.09.00.00 14
44 X2016.08.17.09.00.00.12.00.00 15
45 X2016.08.17.12.00.00.15.00.00 22
46 X2016.08.17.15.00.00.18.00.00 35
47 X2016.08.17.18.00.00.21.00.00 20
48 X2016.08.17.21.00.00.00.00.00 6
49 X2016.08.18.00.00.00.03.00.00 0
50 X2016.08.18.03.00.00.06.00.00 2
I tried to create the following plot. But I only want to keep x-axis labels at few regular intervals. I tried setting breaks but couldn't figure out.
Following is the code
ggplot(data=mdf, aes(x=DateTime, y=value, group = X)) + geom_line() +
geom_point( size=2, shape=21, fill="white") +
labs(x = "DateTime", y = "") + scale_x_discrete(labels = datetime) +
theme(axis.text.x = element_text(angle = 90, hjust = 1))