title: How to draw rectangle outside of the plot frame in Matplotlib
body: <p>I want to generate the subfigure's title in the style of followed figure:</p>
  <p><a href="https://i.stack.imgur.com/lmTue.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lmTue.png" alt="enter image description here" /></a></p>
  <p>A gray box should be beneath the title which are at the top of the scatter point.</p>
  <p>Here is the code I have tried:</p>
  <pre><code>x = random.sample(range(50), 50)
  y= random.sample(range(50), 50)
  
  fig = pyplot.figure()
  ax = pyplot.subplot(111)
  ax.scatter(x,y,label='a')
  ax.set_aspect('equal')
  ax.set_xlim(0,60)
  ax.set_ylim(0,60)
  ax.plot([0,60], [0, 60], color='k', linestyle='-', linewidth=1.25)
  
  ax.add_patch(patches.Rectangle((0,60),60, 10,facecolor='silver',linewidth = 0))
  TITLE = ax.text(26,61, r'$\mathregular{Title}$',fontsize = 14,zorder = 5,color = 'k')
  </code></pre>
  <p>The result show like:</p>
  <p><a href="https://i.stack.imgur.com/iA55S.png" rel="noreferrer"><img src="https://i.stack.imgur.com/iA55S.png" alt="enter image description here" /></a></p>
  <blockquote>
  <p>The rectangle as the background box of title can't be shown in my result</p>
  </blockquote>
  <p>Any advice or better solution are appreciate!</p>