title: Setting x-axis ticks at intervals pmf in Matplotlib
body: <p>I am trying to plot the pmf for temperature data, but all the x axis labels are overlapping.</p>
  <p>my pmf data looks like this:</p>
  <pre><code>8.4     0.001212
  8.6     0.000808
  8.8     0.000404
  8.9     0.001212
  9.0     0.001212
            ...   
  </code></pre>
  <p>I created this Series from the df sensor_a with the following code</p>
  <pre><code>pmf_a = sensor_a['Temperature'].value_counts().sort_index() / len(sensor_a['Temperature'])
  </code></pre>
  <p>where temperature the temperature column in the df sensor_a is temperature in degrees</p>
  <p>this is the code that I used to make the plots</p>
  <pre><code>fig , axes = plt.subplots(nrows = 1, ncols = 5, figsize=(20,5))
  plt.sca(axes[0])
  pmf_a.plot(kind = 'bar')
  plt.title('PMF of the Temperature of A')
  plt.xticks(np.arange(min(sensor_a.Temperature), max(sensor_a.Temperature)+1, 2.0))
  </code></pre>
  <p>but this results in a group of x labels on the right.</p>
  <p>Does anybody recognize this problem and have a solution?</p>
  <p><a href="https://i.stack.imgur.com/vIZ0y.png" rel="nofollow noreferrer">resulting plot with x axis labels to the right</a></p>