How to remove the border around legend ?

Hello all,

When you create a graph with a legend using legend(), is there a way to remove
the black border drawn around the legend ?

Thanks.

Hello all,

When you create a graph with a legend using legend(), is there a way to remove
the black border drawn around the legend ?

I asked the same question some time ago. The trick is setting the
linewidth to zero:

from pylab import *
....
lg = legend()
lg.get_frame().set_linewidth(0)

Maybe there are other ways, but this one works for me.

Cheers,
YVES

···

On Thu, Feb 28, 2008 at 9:33 AM, darckense <darckense@...185...> wrote:

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Another way:

plot(random.rand(10), label='foo')
l = legend()
l.draw_frame(False)
draw()

Note, this takes away the white background of the legend axis as well. This may or may not be desirable.

-Rob

···

On Feb 28, 2008, at 10:23 AM, yves frederix wrote:

On Thu, Feb 28, 2008 at 9:33 AM, darckense <darckense@...185...> wrote:

I asked the same question some time ago. The trick is setting the
linewidth to zero:

from pylab import *
....
lg = legend()
lg.get_frame().set_linewidth(0)

Maybe there are other ways, but this one works for me.

----
Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331

Thanks for your tip, it's work perfectly ! :slight_smile: