I think a Paul's answer here found the same issue. Rect2 = Rectangle(, bbox2.width, bbox2.height, \Ĭlearly the red box is too small. Rect1 = Rectangle(, bbox1.width, bbox1.height, \ Renderer2 = mpl.backend_bases.RendererBase() Here is a simple example import matplotlib as mpl Some backends do not have the method _renderer(), so I tried matplotlib.backend_bases.RendererBase() to get the renderer and it did not produce satisfactory results. The post here, helped me realize that I can use the method text.get_window_extent(renderer) to get the bounding box, but I have to supply the correct renderer. I would like to get the bounding box (dimensions) around some text in a matplotlib figure.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |