On Sun, Sep 26, 2010 at 4:11 AM, Jouni K. Seppänen <j...@iki.fi> wrote:
> I'm not sure either. It seems that the two-number form of the bounding
> box is meant to create a degenerate bounding box so that any kind of
> location specifier ("upper right", "lower center", etc) will always hit
> that exact place, but perhaps naturally that makes it difficult to move
> the box around.
>

In the current implementation, the legend location (Legend.loc) is set
in the normalized coordinate of the bbox_to_anchor (and later
transformed to the "canvas coordinate" during the drawing time).

On the other hand, when the legend is moved by a user, it tries to
update Legend.loc from the current position of the legend in the
canvas coordinate, which results in NaNs if the bbox_to_anchor has
zero width and zero height. A workaround is to set the bbox_to_anchor
to its default value (Axes.bbox) when this happens. While I think it
is reasonable thing to do, let me know of any other opinion.

A patch is attached.
Unless there is no objection, I'll commit the patch soon.

Regards,

-JJ

Attachment: fix_bbox_to_anchor_for_draggable_legend.diff
Description: Binary data

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to