We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53f6a70 commit c564bafCopy full SHA for c564baf
lib/matplotlib/offsetbox.py
@@ -641,14 +641,14 @@ def get_extent(self, renderer):
641
bbox, info = self._text._get_layout(renderer)
642
w, h = bbox.width, bbox.height
643
644
- line = info[0][0] # first line
645
-
+ line = info[-1][0] # last line
646
_, hh, dd = renderer.get_text_width_height_descent(
647
line, self._text._fontproperties, ismath=ismath)
648
+ d = dd # the baseline of the last line
649
650
self._baseline_transform.clear()
651
- d = h-(hh-dd) # the baseline of the first line
+
652
if len(info) > 1 and self._multilinebaseline:
653
d_new = 0.5 * h - 0.5 * (h_ - d_)
654
self._baseline_transform.translate(0, d - d_new)
0 commit comments