>>>>> "David" == David Goldsmith <[EMAIL PROTECTED]> writes:

    David> OK, I was afraid of that; in that case, is there some way
    David> to get the height and width of the legend (so I can do what
    David> I want programatically)?  Thanks again,

Again, afraid not.  At least nothing obvious.  The legend placement is
done dynamically at draw time, and so it will be difficult to get this
information ahead of time.  There might be some cleverness that can be
applied, but nothing easy.

One option would be connect to the draw event, and then inspect the
legend properties, and then place it where you want knowing the width
and the height.  Not too elegant, but serviceable.  Here is an 
untested sketch


def ondraw(event):
    if ondraw.done: return 
    # in pixels
    left,bottom,width,height = leg.legendPatch.get_window_extent().get_bounds()
    # move your legend....
    ondraw.done = True
ondraw.done = False    

fig = figure()
ax = fig.add_subplot(111)
leg = ax.legend(blah)
fig.canvas.mpl_connect('draw_event', ondraw)


It might be better to patch legend directly to do what you want and
send the patch our way.  Or subclass it.

JDH

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to