title: Figure and axes methods in matplotlib
body: <p>Say I have the following setup:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  
  x = np.arange(5)
  y = np.exp(x)
  fig1 = plt.figure()
  ax1 = fig1.add_subplot(111)
  ax1.plot(x, y)
  </code></pre>
  
  <p>I would like to add a title to the plot (or to the subplot).</p>
  
  <p>I tried:</p>
  
  <pre><code>&gt; fig1.title('foo')
  AttributeError: 'Figure' object has no attribute 'title'
  </code></pre>
  
  <p>and </p>
  
  <pre><code>&gt; ax1.title('foo')
   TypeError: 'Text' object is not callable
  </code></pre>
  
  <p>How can I use the object-oriented programming interface to matplotlib to set these attributes? </p>
  
  <p>More generally, where can I find the hierarchy of classes in matplotlib and their corresponding methods?</p>