title: plt.subplot axis sharing not working
body: <p>I'm trying to plot some subplots and I can't seem to share axes. I've seen other code and they seem to be doing exactly as I'm attempting but mine doesn't appear to do anything.</p>
  
  <p>I simply want to share the respective axes in the four subplots on the left while keeping the subplot on the far right separate.</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  # set the data
  x_data = np.linspace(0, 10)
  y_data_1 = np.sin(x_data)
  y_data_2 = np.cos(x_data)
  y_data_3 = [i / 2 for i in y_data_1]
  y_data_4 = [j / 2 for j in y_data_2]
  
  # make the plot
  ax1 = plt.subplot(2,3,1)
  plt.plot(x_data, y_data_1)
  
  ax2 = plt.subplot(2,3,2, sharey=ax1)
  plt.plot(x_data, y_data_1)
  plt.plot(x_data, y_data_2)
  
  ax3 = plt.subplot(1,3,3)
  plt.plot(x_data)
  
  ax4 = plt.subplot(2,3,4, sharex=ax1)
  plt.plot(x_data, y_data_1)
  plt.plot(x_data, y_data_2)
  plt.plot(x_data, y_data_3)
  
  ax5 = plt.subplot(2,3,5, sharex=ax2, sharey=ax4)
  plt.plot(x_data, y_data_1)
  plt.plot(x_data, y_data_2)
  plt.plot(x_data, y_data_3)
  plt.plot(x_data, y_data_4)
  
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/fmJjk.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fmJjk.png" alt="enter image description here"></a></p>
  
  <p>As you can see, despite adding sharex and sharey arguments into the plt.subplot commands the plot returned shows all unique subplots.</p>
  
  <p>I'm sure I'm making a minor error, but I've tried this in the past and remember that I had the same issue! Any help appreciated, as well as recommendations for alternative approaches. Even the website contains various ways of doing the same thing and it is a little confusing.</p>