title: Python + Matplotlib -> NoneType error with twinx
body: <p>I think I'm missing something in the workflow of matplotlib...  I'm trying to create a figure of custom size, add some stuff, then add a second axis:</p>
  
  <pre><code>#temp graph
  import matplotlib.pyplot as plt
  plt.cla()
  plt.clf()
  plt.close()
  df = r
  
  fig = plt.figure(figsize=(14,6))
  ax = fig.add_subplot()
  
  #r is a dataframe filled with a bunch of data
  
  myplot = r[r.index&lt;=100]["TOTAL DATA"].apply(lambda x:x/1000).plot(kind='bar')
  ax2 = ax.twinx()
  plt.show()
  </code></pre>
  
  <p>This gives me the following error:</p>
  
  <blockquote>
    <p>AttributeError                            Traceback (most recent call
    last)  in ()
         13 
         14 
    ---> 15 ax2 = ax.twinx()
         16 
         17 plt.show()</p>
    
    <p>AttributeError: 'NoneType' object has no attribute 'twinx'</p>
  </blockquote>
  
  <p>Any thoughts?   Thanks!</p>