I still have a bit of a problem. This puts the legend
> "more or less" outside the plot. If I use "upper right"
> with only two lines it is o.k., however if I use
> e.g. "center right" then about half of the legend is still
> over the top of the plot.
I think the best approach is to use fig.add_axes rather than
fig.add_subplot to create your axes. Then you can make it the exact
size you want. You can also place the figure legend anywhere you want
by using loc=(x,y) instead of a location string. I just noticed this
was undocumented :-(. It *is* documented for the axes legend, and
I'll fix the figure legend docstring for the next release.
Here's a little example
import pylab as p
fig = p.figure()
ax = fig.add_axes([0.1, 0.3, 0.4, 0.4])
lines = ax.plot([1,2,3])
fig.legend(lines, ('hi', ), loc=(0.6, 0.6))
Hope this helps,