title: Matplotlib legend in increasing order
body: <p>I have text files named as 5.txt, 10.txt, 15.txt, 20.txt but when I read the files with glob module and use fname variable in the legend I get disorganized legend data. </p>
  
  <pre><code>for fname in glob("*.txt"):
  
      potential, current_density = np.genfromtxt(fname, unpack=True)
      current_density = current_density*1e6
      ax = plt.gca()
      ax.get_yaxis().get_major_formatter().set_useOffset(False)
      plt.plot(potential,current_density, label=fname[0:-4])
  
  plt.legend(loc=4,prop={'size':12}, 
             ncol=1, shadow=True, fancybox=True,
             title = "Scan rate (mV/s)")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/iD8LB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iD8LB.png" alt="enter image description here"></a></p>
  
  <p>How can I plot and give the corresponding label to the data with in increasing order?</p>