title: Datetime format in Matplotlib and mplfinance
body: <p>I'm new to data science and I'm trying to plot the stock ohlc from a csv file which has data from 2000 to 2020.</p>
  <p>I'd like to show the year on the x-axis but it only shows the month.
  How can I only show the year?</p>
  <p>I'd also like to revert and limit the year of the stock price because in the csv file the date starts from 2020 and goes all the way down to 2000.
  I want to limit the time frame that pandas reads from the csv. for example from 2019-01 to 2020-01.
  This is what I have written so far:</p>
  <pre><code>file = r&quot;C:\Users\Aryan\Desktop\myData.csv&quot;
  data = pd.read_csv(file)
  data.timestamp = pd.to_datetime(data.timestamp, format=&quot;%Y/%m/%d&quot;)
  data.info()
  data.timestamp
  data = data.set_index('timestamp')
  </code></pre>
  <p>When I plot the data using matplotlib and mplfinance I get this result:</p>
  <pre><code>mpf.plot(data['2019-10':'2020-1'], type='candle', 
           figratio=(30,15),
           title='Some stock price',
           tight_layout=True,
           style = 'yahoo',
           mav=(20), volume=True)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/dc5v4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dc5v4.png" alt="enter image description here" /></a></p>
  <p>For example I want the Jan 28, 00:00 and all other timestamps look like Jan 28, 2020.</p>