title: Merge matplotlib subplots with shared x-axis
body: <p>I have two graphs to where both have the same x-axis, but with different y-axis scalings. </p>
  
  <p>The plot with regular axes is the data with a trend line depicting a decay while the y semi-log scaling depicts the accuracy of the fit.</p>
  
  <pre><code>fig1 = plt.figure(figsize=(15,6))
  ax1 = fig1.add_subplot(111)
  
  # Plot of the decay model 
  ax1.plot(FreqTime1,DecayCount1, '.', color='mediumaquamarine')
  
  # Plot of the optimized fit
  ax1.plot(x1, y1M, '-k', label='Fitting Function: $f(t) = %.3f e^{%.3f\t} \
           %+.3f$' % (aR1,kR1,bR1))
  
  ax1.set_xlabel('Time (sec)')
  ax1.set_ylabel('Count')
  ax1.set_title('Run 1 of Cesium-137 Decay')
  
  # Allows me to change scales
  # ax1.set_yscale('log')
  ax1.legend(bbox_to_anchor=(1.0, 1.0), prop={'size':15}, fancybox=True, shadow=True)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/qzJwy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qzJwy.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/ci4jI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ci4jI.png" alt="enter image description here"></a></p>
  
  <p>Now, i'm trying to figure out to implement both close together like the examples supplied by this link
  <a href="http://matplotlib.org/examples/pylab_examples/subplots_demo.html" rel="noreferrer">http://matplotlib.org/examples/pylab_examples/subplots_demo.html</a></p>
  
  <p>In particular, this one</p>
  
  <p><a href="https://i.stack.imgur.com/1DNBU.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1DNBU.png" alt="enter image description here"></a></p>
  
  <p>When looking at the code for the example, i'm a bit confused on how to implant 3 things:</p>
  
  <p>1) Scaling the axes differently</p>
  
  <p>2) Keeping the figure size the same for the exponential decay graph but having a the line graph have a smaller y size and same x size.</p>
  
  <p>For example:</p>
  
  <p><a href="https://i.stack.imgur.com/o32et.png" rel="noreferrer"><img src="https://i.stack.imgur.com/o32et.png" alt="enter image description here"></a></p>
  
  <p>3) Keeping the label of the function to appear in just only the decay graph.</p>
  
  <p>Any help would be most appreciated.</p>