Plotting the legend "above" the gridlines

The command: ax = lab.subplot(111, axisbelow='True')

    > ensures that the gridlines appear below the bars on a plot;
    > how can the same be done for the legend (ie the grid below
    > the legend and not running through it)?

Hmm, I don't see this in matplotlib svn. Ie, in the example below, the
grid is below the legend.

  In [1]: ax = subplot(111, axisbelow=True)

  In [2]: plot([1,2,3], label='test')
  Out[2]: [<matplotlib.lines.Line2D instance at 0xb581b6ac>]

  In [3]: legend()
  Out[3]: <matplotlib.legend.Legend instance at 0xb581bc4c>

  In [4]: grid()

If this doesn't work for you and you cannot upgrade, you may be able
to increase the zorder of your legend

  l = legend(...)

and see if that helps.