title: Python pyplot histogram: Adjusting bin width, Not number of bins
body: <p>I have been able to make myself a pretty little histogram that looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/qke2B.png" alt="One day it will be pretty"></p>
  
  <p>I was able to produce the image with the following code:</p>
  
  <pre><code>    import numpy as np
      import matplotlib.pyplot as plt
  
      plt.figure()  
      plt.axis([0, 6000, 0, 45000])  
  
      data['column'][data.value == 0].hist(bins=200, label='A') 
      data['column2'][data.value == 1].hist(bins=200, label='B')
  
      plt.title('A Histogram')  
      plt.xlabel('x-axis')  
      plt.ylabel('y-axis')  
      plt.legend()  
  
      return plt
  </code></pre>
  
  <p>Which is all fine and good, but the bins are not equal lengths. The only way I have been able to get the bins at equal lengths is to do something like this:</p>
  
  <pre><code> bins=[0,100,200,300,400,.......)
  </code></pre>
  
  <p>Which is not pretty at all. </p>
  
  <p>I have googled a bit and looked around here. The most popular answer to a similar question is <a href="https://stackoverflow.com/questions/6986986/bin-size-in-matplotlib-histogram/%22this%20guy%22">this guy</a> which suggests a seemingly excellent answer that I can not get to work for the life of me. </p>
  
  <p>Thanks for your help!</p>