In a word, I'd like to know the width and height of a legend so that my program could modify the axes automatically.
Here is a image that illustrated my question:
As you can see, some part of the legend goes out of the axes. I think this problem could be solved if I know the height and width of the legend.
I have readed Rectangle, FancyBboxPatch and something that will helpfull, I think, on the official site. I know that there is something about size: For FancyBboxPatch:
get_frame():
Return the Rectangle used to frame the legend. But it returns a FancyBboxPatch in fact.
get_bbox_to_anchor():
Return the bbox that the legend will be anchored to. But I know that the function has nothing to do with my problem.
I'd like to know the height and width of the grey border that a arrow pointed. An arrow pointed the border:
Thank you for your help!