title: Matplotlib: quarterly minor tick labels
body: <p>I have quarterly data that I'm trying to plot using Matplotlib. I want the major xtick labels to show the years and the minor xtick labels show the quarters.</p>
  
  <p>All I can find, however, is for <em>monthly</em> data. That is, the following code (using matplotlib's mdates function) will make the minor xticks monthly, but I don't see a quarterly option...</p>
  
  <p>Any help?</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib.dates as mdates
  
  A = pd.DataFrame(np.random.rand(6*4))
  A.index = pd.date_range(start = "2017", periods = len(A), freq = "QS")
  
  fig, ax = plt.subplots(figsize = (10,6))
  
  ax.plot(A)
  
  years = mdates.YearLocator()   # every year
  months = mdates.MonthLocator()  # every month
  yearsFmt = mdates.DateFormatter('%Y')
  
  ax.xaxis.set_major_locator(years)
  ax.xaxis.set_major_formatter(yearsFmt)
  ax.xaxis.set_minor_locator(months)
  </code></pre>