title: Histogram plotting "AttributeError: max must be larger than min in range parameter."
body: <p>I have a dataset (as a .txt file) used to make a histogram, but a journal has asked me to normalize the data and plot a histogram of the normalized data instead. However, I'm getting a "AttributeError: max must be larger than min in range parameter." error when I'm trying to plot the normalized data. Basically, H1 is my list of data (some may include nan values which I'm attempting to remove), and I'm trying to normalize the remaining data</p>
  
  <pre><code>import numpy as np
  from numpy import array
  import matplotlib.pyplot as plt
  
  H1 = np.loadtxt('histogramrate25p10area30.txt') #Import data from txt file
  
  newH1 = [x for x in H1 if x != 'nan'] #Remove nan values
  norm1 = [float(i)/max(newH1) for i in newH1] #Normalize remaining values
  
  nbins1 = 400
  
  plt.figure()
  
  plt.subplot(111)
  plt.hist(norm1, nbins1, color='purple', alpha=0.5)
  plt.ylabel('Frequency', fontsize=20)
  
  plt.show()
  </code></pre>
  
  <p>From browsing this website, the error resulted from the presence of nan values, but I thought in my newH1 list above, I've removed all the nan values, so I'm unsure what is causing this error.</p>