title: Issue with x-axis labels in a time-series plot
body: <p>I want to plot data from a time-series object and properly customise the labels that are shown in the x-axis.</p>
  <p>The data I am plotting correspond to monthly values, from January 2017 to December 2017.</p>
  <p>I've read other similar posts on the same subject here, and I have tried everything I imagined, but I can't make this work:</p>
  <pre><code># Data to be plotted
  actual &lt;- c(153.3, 12.5, 52, 23, 11.8, 20.8, 1.9, 26.4, 6, 17, 7.4, 3.5)
  
  # Transform them into a time-series object
  ts_actual &lt;- ts(actual, frequency = 12, start = c(2017, 1), end = c(2017, 12))
  
  # Create the labels
  labels.chart = seq(as.Date(&quot;2017-01-01&quot;), as.Date(&quot;2017-12-01&quot;), by = &quot;months&quot;)
  
  # My plot
  plot(ts_actual, col = &quot;blue&quot;, type = &quot;p&quot;, ylim = c(-100, 200), xaxt = &quot;n&quot;)
  
  # This does not work:
  axis(1, labels.chart , format(labels.chart, &quot;%Y-%m&quot;))
  
  # Neither does this:
  axis.Date(side = 1, at = labels.chart , format = &quot;%Y-%m&quot;)
  </code></pre>
  <p>This is what I get:
  <a href="https://i.stack.imgur.com/3qiOM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3qiOM.png" alt="enter image description here" /></a></p>
  <p>Any hint on what I am missing?</p>
  <p>I want to keep my data as a time-series object because this is a part of a time-series analysis. Default x-axis labels are not appropriate:</p>
  <pre><code># Data to be plotted
  actual &lt;- c(153.3, 12.5, 52, 23, 11.8, 20.8, 1.9, 26.4, 6, 17, 7.4, 3.5)
  
  # Transform them into a time-series object
  ts_actual &lt;- ts(actual, frequency = 12, start = c(2017, 1), end = c(2017, 12))
  
  # Create the labels
  labels.chart = seq(as.Date(&quot;2017-01-01&quot;), as.Date(&quot;2017-12-01&quot;), by = &quot;months&quot;)
  
  # My plot
  plot(ts_actual, col = &quot;blue&quot;, type = &quot;p&quot;, ylim = c(-100, 200))
  </code></pre>
  <p>The plot with default labels:
  <a href="https://i.stack.imgur.com/MaW8t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MaW8t.png" alt="enter image description here" /></a></p>
  <p>So, how can I fix this (without using <code>ggplot2</code> or other unnecessary packages)?</p>