title: How to share x axes of two subplots after they have been created
body: <p>I'm trying to share two subplots axes, but I need to share the x axis after the figure was created. E.g. I create this figure:</p>
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import matplotlib.pyplot as plt
  
  t = np.arange(1000)/100.
  x = np.sin(2*np.pi*10*t)
  y = np.cos(2*np.pi*10*t)
  
  fig = plt.figure()
  ax1 = plt.subplot(211)
  plt.plot(t,x)
  ax2 = plt.subplot(212)
  plt.plot(t,y)
  
  # some code to share both x axes
  
  plt.show()
  </code></pre>
  <p>Instead of the comment I want to insert some code to share both x axes.
  How do I do this? There are some relevant sounding attributes
  <code>_shared_x_axes</code> and <code>_shared_x_axes</code> when I check to figure axis (<code>fig.get_axes()</code>) but I don't know how to link them.</p>