title: Remove top and right axes of all Matplotlib figures
body: <p>I have Python code similar to the example below to remove the top and right axes of plots created with Matplotlib. The tick marks are also removed for all plot axes.</p>
  
  <pre><code>py.close('all')
  
  py.figure(1)
  py.plot(x1, y1)
  py.grid()
  
  py.figure(2)
  py.plot(x2, y2)
  py.grid()
  
  py.figure(3)
  py.plot(x3, y3)
  py.grid()
  
  ax = py.gca()
  ax.spines['top'].set_visible(False)
  ax.spines['right'].set_visible(False)
  py.tick_params(axis='both', bottom='off', top='off', left='off', right='off')
  
  py.show()
  </code></pre>
  
  <p>Unfortunately, the desired effect is only applied to the last plot figure. To remove the top/right axes and tick marks for all figures, I have to place the following code after each figure: </p>
  
  <pre><code>ax = py.gca()
  ax.spines['top'].set_visible(False)
  ax.spines['right'].set_visible(False)
  py.tick_params(...)
  </code></pre>
  
  <p>Is it possible to customize the axes of all figures at once using Matplotlib?</p>