title: Python plot Legend Key Format
body: <p>I am trying to plot a set of data in python. I'm using matplotlib.pyplot library to do this.</p>
  
  <p>I got everything working, but I have this one issue where the last key in the legend comes out with a weird format than the others. I tried to do different settings to get this fixed with no luck so far... Can anyone help me fix that CH4 (A) to show in the same format as the other keys?</p>
  
  <p>The format looks much like this in the plot (I cannot post picture until I get 10 reputations</p>
  
  <p>CH1 (A)</p>
  
  <p>CH2 (A)</p>
  
  <p>CH3 (A)</p>
  
  <p>CH4 </p>
  
  <p>(A</p>
  
  <p>)</p>
  
  <p>Here is my code to set up legend.</p>
  
  <pre><code>legends = data[16]
  legends = legends.split(",")
  
  if numChannels == 1:
      plt.plot(raw[:,0],raw[:,1], label=legends[1] + " (" + units[1] + ")")
  elif numChannels == 2:
      plt.plot(raw[:,0],raw[:,1], label=legends[1] + " (" + units[1] + ")")
      plt.plot(raw[:,0],raw[:,2], label=legends[2] + " (" + units[2] + ")")
  elif numChannels == 3:
      plt.plot(raw[:,0],raw[:,1], label=legends[1] + " (" + units[1] + ")")
      plt.plot(raw[:,0],raw[:,2], label=legends[2] + " (" + units[2] + ")")
      plt.plot(raw[:,0],raw[:,3], label=legends[3] + " (" + units[3] + ")")
  elif numChannels == 4:
      plt.plot(raw[:,0],raw[:,1], label=legends[1] + " (" + units[1] + ")")
      plt.plot(raw[:,0],raw[:,2], label=legends[2] + " (" + units[2] + ")")
      plt.plot(raw[:,0],raw[:,3], label=legends[3] + " (" + units[3] + ")")
      plt.plot(raw[:,0],raw[:,4], label=legends[4] + " (" + units[4] + ")")
  plt.legend(loc=0)
  plt.xlabel(legends[0])
  plt.ylabel("Data")
  plt.title(filestr)
  plt.show()
  </code></pre>
  
  <p>legends is data I am reading in from a .csv file. I'm not really sure why this happens. This only happens to the last legend. E.g. if I have 4 data set and plot 3, they come out fine, but if I plot all 4 or only have 1 data set and plot, the key is formatted differently as shown above.</p>