My dataframe consists of daily temperature data for the months June, July and August of the years 2002 - 2017.
date temperature
2002-06-01 9.882000
2002-06-02 9.698667
2002-06-03 12.941667
...
2017-08-29 13.271125
2017-08-30 16.332750
2017-08-31 20.986000
The dates are in format POSIXct. I´m trying to create a plot that shows only the relevant months per year. I tried ggplot2 with the following code:
ggplot(NULL, aes(x = date, y = temperature)) +
geom_line(data = tair_summer_night_mean, color = "blue") +
xlab(label = "Time") +
ylab(label = "Night time temperature in °C")
This leads to:
Is there a way to tell ggplot not to display the space where I have no data?