I realized after sending that off that I need to provide more context…sorry about that.
What I’m trying to do can be boiled down to the following: I’m trying to place a legend precisely, using the top left corner of legend as the “sticky” point. In other words, if I want to place the legend here:
···
±--------------------------------±----------+
> > > legend |
The plot... |-----------+
> > >
> > >
±--------------------------------+
I would have thought that I would set bbox_to_anchor = (0,0,1,1), and loc = (1,1). I found out quickly, though, that this places the legend like this:
+-----------+
> >
> legend |
±--------------------------------±----------+
>
>
The plot... |
>
>
>
>
>
>
±--------------------------------+
Which makes perfect sense from matplotlib’s perspective. So all I need to do is figure out how tall the legend is, and subtract that off the y coordinate before passing ‘loc’ off to matplotlib’s legend. I just can’t seem to figure out how to get that number. I tried self.ax.get_legend().get_frame().get_height(), but that just returns 1 all the time.
Ascii art is fun!
–
Daniel Hyams
dhyams@…287…