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 : ax = subplot(111, axisbelow=True)
In : plot([1,2,3], label='test')
Out: [<matplotlib.lines.Line2D instance at 0xb581b6ac>]
In : legend()
Out: <matplotlib.legend.Legend instance at 0xb581bc4c>
In : 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.