title: matplotlib.pyplot.hist returns a histogram where all bins have the same value when I have varying data
body: <p>I am trying to create a histogram in python using matplotlib.pyplot.hist.
  I have an array of data that varies, however when put my code into python the histogram is returned with values in all bins equal to each other, or equal to zero which is not correct.</p>
  
  <p>The histogram should look the the line graph above it with bins roughly the same height and in the same shape as the graph above.</p>
  
  <p>The line graph above the histogram is there to illustrate what my data looks like and to show that my data does vary.</p>
  
  <p>My data array is called spectrumnoise and is just a function I have created against an array x</p>
  
  <pre><code>x=np.arange[0.1,20.1,0.1]
  </code></pre>
  
  <p>The code I am using to create the histogram and the line graph above it is</p>
  
  <pre><code>import matplotlib.pylot as mpl 
  mpl.plot(x,spectrumnoise)
  mpl.hist(spectrumnoise,bins=50,histtype='step')
  mpl.show()
  </code></pre>
  
  <p>I have also tried using </p>
  
  <pre><code>mpl.hist((x,spectrumnoise),bins=50,histtype=step)
  </code></pre>
  
  <p>I have also changed the number of bins countless times to see if that helps an normalising the histogram function but nothing works.</p>
  
  <p>Image of the output of the code can be seen here 
  <img src="https://i.stack.imgur.com/Dz4iq.jpg" alt="enter image description here"></p>