title: Why can't I set the y-axis range on a plot produced from a Pandas Series?
body: <p>I'm trying to create a bar graph where the y-axis ranges from 0% - 100% using matplotlib and pandas. The range I get is only 0% - 50%. Now, since all of my bars top out at ~10%, this isn't disastrous. It's just frustrating and may interfere with comparisons to other plots with the complete range.</p>
  <p>The code I'm using is (roughly) as follows:</p>
  <pre><code>from matplotlib import pyplot as plt
  import pandas as pd
  
  labels = list(cm.index) #Where cm is a DataFrame
  
  for curr in sorted(labels):
      xa = cm[curr] # Pulls 1 column out of DataFrame to be plotted
      xplt = xa.plot(kind='bar', rot = 0, ylim = (0,1))
      xplt.set_yticklabels(['{:3.0f}%'.format(x*10) for x in range(11)])
      plt.show()
  </code></pre>
  <p>Is there anything obviously wrong or missing?</p>
  <hr />
  <p>A sample of a plot I get is this:</p>
  <p><a href="https://i.stack.imgur.com/cMq2R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cMq2R.png" alt="enter image description here" /></a></p>
  <p>Oddly, when I omit the set_yticklabels statement, I get this:</p>
  <p><a href="https://i.stack.imgur.com/OIN9P.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OIN9P.png" alt="enter image description here" /></a></p>
  <p>I now realize that the first graph is not just oddly scaled, but is also giving incorrect results. The values shown in the 2nd graph are the correct ones. I guess the error is in the set_yticklabels statement, but I have no idea what it could be.</p>