This might be a feature rather than a bug.
The legend auto-placement code is a bit lazy – due to the fact that I
wrote it rather than JDH
Anyway, it only tries to avoid the points that define a line, rather
than the lines themselves.
Much of the time that works well, but since it only takes two points to
define a line you can end up with the lines crossing the legend. The
good news is that if a line does cross the legend, and you can see a
better position for the legend then it almost surely means that the
line is straight throughout the region where it crosses the legend.
Try using the pan/zoom buttons on your plot to move a point into the
legend area and it should jump out of the way.
Eg: try this little snippet – use your pan/zoom skills to position one
of the dots over the legend
from pylab import *
plot(range(5), ‘o-’, label=‘oops’)
John Hunter wrote: