title: Logarithmic y-axis bins in python
body: <p>I'm trying to create a histogram of a data column and plot it logarithmically (<code>y-axis</code>) and I'm  not sure why the following code does not work:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  data = np.loadtxt('foo.bar')
  fig = plt.figure()
  ax = fig.add_subplot(111)
  plt.hist(data, bins=(23.0, 23.5,24.0,24.5,25.0,25.5,26.0,26.5,27.0,27.5,28.0))
  ax.set_xlim(23.5, 28)
  ax.set_ylim(0, 30)
  ax.grid(True)
  plt.yscale('log')
  plt.show()
  </code></pre>
  
  <p>I've also tried instead of <code>plt.yscale('log')</code> adding <code>Log=true</code> in the <code>plt.hist</code> line and also I tried <code>ax.set_yscale('log')</code>, but nothing seems to work. I either get an empty plot, either the <code>y-axis</code> is indeed logarithmic (with the code as shown above), but there is no data plotted (no bins). </p>