title: Multiple figures with subplots from a dataframe
body: <p>I have a dataframe for which I am plotting the sorted values from the columns as a line and then plotting and labeling various percentiles along that line.</p>
  <p>I would like to have 12 subplots per figure and as many figures as I need depending on the number of columns (which will vary on my real datasets).</p>
  <p>Here is a version of my script with a simple dataframe. This example produces 2 figures, each with 12 subplots. There are only 17 entries in the dataframe, so one figure has 7 emply subplots. This is the result that I need, however, the script is not elegant and not effiecient.</p>
  <p>I am learning python and tend to revert back to old scripting habits when I can't figure out the efficient python way. Could someone show me how to produce the same figures with more elegant python? If I don't have 7 empty subplots, that fine too. I've tried various combinations.  I think I'm getting tripped up on not understanding the inner workings of <code>pandas</code> versus <code>numpy</code>.  I have a pandas Dataframe, but am manipulating the columns with numpy functions.  In my trials I had many errors when attempting to apply the <code>np.sort</code> to the dataframe columns, which is why I reverted back to taking a single column at a time out of the dataframe to manipulate and then plot.</p>
  <pre><code>df = pd.DataFrame(np.random.randint(0,100,size=(15, 17)), columns=list('ABCDEFGHIJKLMNOPQ'))
  p = np.array([0.0, 25.0, 50.0, 75.0, 90.0, 95.0, 99.0, 100.0])
  j=2
  i=1
  fig, axs = plt.subplots(4,3, figsize=(8.5, 11), facecolor='w', edgecolor='k')
  fig.subplots_adjust(hspace=0.4, wspace=0.4)
  for f in df.columns:
      d=df[f]
      d=np.sort(d)
      perc = np.nanpercentile(d, p)
      if i &gt;12:
         fig, axs = plt.subplots(4,3, figsize=(8.5, 11), facecolor='w', edgecolor='k')
         i=1
         j=j+1
      plt.subplot(4, 3, i)
      plt.plot(d)
      plt.plot((len(df[f])-1) * p/100., perc, 'ro')
      plt.xticks((len(df[f])-1)* p/100., map(str, p))
      plt.show()
      i=i+1
  
  </code></pre>