title: How to set y-axis for historgram in Python?
body: <p>According to the <a href="http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.set_ylim" rel="nofollow">documentation</a>, one can set the range of the x-axis using the <code>hist</code> function, but there doesn't seem to be a way to control the y-axis.</p>
  
  <p>I have a figure with 4 subplots, arranged in a 2x2 fashion, all of which are histograms. I have made their x-axis to be entirely the same by setting the <code>range</code>, but have been unable to figure out how to do likewise with the y-axis. But when I try to control the y-axis, using <code>set_ylim</code>, I get an error. When I tried using <code>pylab.axis</code>, the plots didn't turn out correctly (the bars of the historgram all had a y-value of 0.</p>
  
  <pre><code>pylab.hist(myData[x], bins = 20, range=(0,400))
  pylab.axis([0,400,0,300])
  </code></pre>
  
  <p>How do I control the y-axis of the histogram? Essentially what I"m looking for is something like <code>range</code> in the <code>hist</code> function, but for the y-axis.</p>
  
  <hr>
  
  <p><strong>Update:</strong></p>
  
  <pre><code>    plotNumber = 1
  for i in xrange(4):
      pylab.subplot(2, 2, plotNumber)
      pylab.hist(myData[i], bins = 20, range=(0,400))
      pylab.title('Some Title')
      pylab.xlabel('X')
      pylab.ylabel('Y')
      plotNumber += 1
  pylab.show()
  </code></pre>
  
  <p>But when I include </p>
  
  <pre><code>pylab.axis([0,400,0,300])
  </code></pre>
  
  <p>All the y-values correspond to 0 (the histogram is flat).</p>