title: X-axis tick labels are too dense when drawing plots with matplotlib
body: <p>I am drawing matplotlib plots and my x axis consists of YYYYMM formatted strings of year and month like <code>201901</code> for January of 2019.</p>
  
  <p>My problem is that some of the data spans on a long period of time and this makes the x axis tick labels so dense that they pile up on each other and they become unreadable.</p>
  
  <p>I tried making the font smaller and I rotated the labels 90 degrees which helped a lot but it is still not enough for some of my data.</p>
  
  <p>Here is an example of one of my x axis which looks ok:</p>
  
  <p><a href="https://i.stack.imgur.com/SoWZn.png" rel="noreferrer"><img src="https://i.stack.imgur.com/SoWZn.png" alt="x-axis that looks fine"></a></p>
  
  <p>And here is an example of an x axis which is too dense because the data spans on a long period of time:</p>
  
  <p><a href="https://i.stack.imgur.com/oDJs7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oDJs7.png" alt="x-axis labels that are too dense"></a></p>
  
  <p>So I want matplotlib to skip printing a few tick labels when the tick labels start piling up on each other. For example, print the label for January, skip printing the labels for February, March, April and May, print the label for June, and skip printing the labels for July, August etc. But I don't know how to do this?</p>
  
  <p>Or are there any other kind of solutions I can use to overcome this problem?</p>