How to stop legend from obscuring plot?

Could anyone advise me or give me an example of how to prevent a legend
from obscuring a plot, or how I could do this better:

http://www.23hq.com/seanh/photo/2862125/view-large

I tried moving the legend out of the way using (x,y) coords but if I
move it out of the axes viewport it also moves out of the figure, and it
looks silly anyway. I also tried increasing the limits of the axes
beyond those of the data, but that looked silly too. And I tried to
change the font size of the legend but couldn't get it to work.

I think what I need is legends that are outside of the axes viewport but
still inside the figure (the figure needs to get larger) and that are in
a smaller font.

Btw I know I should round off my statistical numbers but that isn't
going to fix it completely.

Thanks!

You could use custom axes (rather than subplots) and a figlegend, eg

http://matplotlib.sf.net/examples/figlegend_demo.py

JDH

···

On Feb 5, 2008 2:17 PM, chombee <chombee@...1335...> wrote:

Could anyone advise me or give me an example of how to prevent a legend
from obscuring a plot, or how I could do this better:

http://www.23hq.com/seanh/photo/2862125/view-large

I tried moving the legend out of the way using (x,y) coords but if I
move it out of the axes viewport it also moves out of the figure, and it
looks silly anyway. I also tried increasing the limits of the axes
beyond those of the data, but that looked silly too. And I tried to
change the font size of the legend but couldn't get it to work.

Thanks for that. Once I also rounded my statistical results using
builtin round it worked perfectly:

http://img215.imageshack.us/img215/7664/figure1pr2.png

···

On Tue, 2008-02-05 at 15:20 -0600, John Hunter wrote:

On Feb 5, 2008 2:17 PM, chombee <chombee@...1335...> wrote:
> Could anyone advise me or give me an example of how to prevent a legend
> from obscuring a plot, or how I could do this better:
>
> http://www.23hq.com/seanh/photo/2862125/view-large
>
> I tried moving the legend out of the way using (x,y) coords but if I
> move it out of the axes viewport it also moves out of the figure, and it
> looks silly anyway. I also tried increasing the limits of the axes
> beyond those of the data, but that looked silly too. And I tried to
> change the font size of the legend but couldn't get it to work.

You could use custom axes (rather than subplots) and a figlegend, eg

http://matplotlib.sf.net/examples/figlegend_demo.py

JDH