'X axis labels in time series representation (PLOT.TS)

I am trying to change the x-axis labels to actual dates for my time series representation that I performed using plot.ts instead of ggplot2. When using the code below, it generates a graph with the weeks 0-500 (total number of weeks in my dataframe), I want it in the YYYY-MM-DD format.

This is my current code :

ts(meteo50001$MeanTemp, start= c(2010,01), frequency = 52)
plot.ts((meteo50001$MeanTemp), 
    main="Mean temperature representation by time series ", 
    xlab="Time",ylab="Mean temp(°C)")

I tried the scale_x_date(date_breaks = "1 month", date_labels = "%m") or scale_x_date(date_labels = "%Y %b %d")

Thanks in advance :)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source