title: Different font sizes in the same annotation of matplotlib
body: <p>I need to annotate a pylab rectangle with few data lines - which are of <em>different</em> length.
  Searching through the matplotlib documentation, and Googling, I could not find a way to give different parts of an annotation different sizes.</p>
  
  <p>The following snippet demonstrates the problem:</p>
  
  <pre><code>import pylab
  from matplotlib.patches import Rectangle
  pylab.rcParams['verbose.level'] = 'debug-annoying' 
  
  def draw_rectangle(lower, upper, entry):
      ax = pylab.subplot(111)
      r = Rectangle( lower, upper[0]-lower[0], upper[1] - lower[1],
              edgecolor='k')
      ax.add_patch(r)
  
      textRank = str(entry['rank'])
      textTeamName = entry['teamName']
      textSubmissionDate = entry['submissionDate']
      text = textRank + "\n" + textTeamName + "\n" + textSubmissionDate
  
      ax.add_artist(r)
      rx, ry = r.get_xy()
      cx = rx + r.get_width()/2.0
      cy = ry + r.get_height()/2.0
  
      ax.annotate(text, (cx, cy), color='w', weight='bold', ha='center', va='center', size=14)
  
  if __name__ == '__main__':
      entry = {'rank': 22, 'submissionDate': '12/21/2012 4:58:45 AM', 'teamName': 'A very very very very very very very very very very long name'}
      lower = [0,0]
      upper = [1,1]
      draw_rectangle(lower, upper, entry)
      pylab.show()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/qDYSj.png" alt="one rectangle with different length&#39;s data">
  E.g., is there a way to have the annotation where the font size of 'teamName' is different than the font size of 'rank'?
  <p><br>
  <em>Another problem</em> is I could not find a way for the font size to correlate to the zooming:<br>
  I'm creating a treemap plot, namely, the pylab window is filled with different sized rectangles. If I want to create annotations for the different rectangles, the long data need to be of very small size (to stay within the respective rectangles' boundaries). However, I'd like the font size of the long data line to <strong>grow</strong> as I zoom in.
  <img src="https://i.stack.imgur.com/PAKUI.png" alt="treemap with annotations"></p>