title: Plotting grids across the subplots Python matplotlib
body: <p>I have tried the following:  </p>
  
  <pre><code>d = [1,2,3,4,5,6,7,8,9]
  f = [0,1,0,0,1,0,1,1,0]
  fig = plt.figure()
  fig.set_size_inches(30,10)
  ax1 = fig.add_subplot(211)
  line1 = ax1.plot(d,marker='.',color='b',label="1 row")
  ax2 = fig.add_subplot(212)
  line1 = ax2.plot(f,marker='.',color='b',label="1 row")
  ax1.grid()
  ax2.grid()
  plt.show()
  </code></pre>
  
  <p>I got the following output : </p>
  
  <p><a href="https://i.stack.imgur.com/7V0dA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7V0dA.png" alt="output"></a>   </p>
  
  <p>But I was expecting the following output:<br>
  <a href="https://i.stack.imgur.com/Rpz4x.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Rpz4x.png" alt="expected output"></a>   </p>
  
  <p>How I can get the grids across the two plots?</p>