diff --git a/lib/matplotlib/tests/baseline_images/test_axes/pie_center_radius.png b/lib/matplotlib/tests/baseline_images/test_axes/pie_center_radius.png index 1f925b75d9d3..f7b7108ce79b 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_axes/pie_center_radius.png and b/lib/matplotlib/tests/baseline_images/test_axes/pie_center_radius.png differ diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 2341032dcf84..f747e65c8e3a 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -4913,9 +4913,10 @@ def test_pie_center_radius(): autopct='%1.1f%%', shadow=True, startangle=90, wedgeprops={'linewidth': 0}, center=(1, 2), radius=1.5) - plt.annotate("Center point", xy=(1, 2), xytext=(1, 1.5), + plt.annotate("Center point", xy=(1, 2), xytext=(1, 1.3), arrowprops=dict(arrowstyle="->", - connectionstyle="arc3")) + connectionstyle="arc3"), + bbox=dict(boxstyle="square", facecolor="lightgrey")) # Set aspect ratio to be equal so that pie is drawn as a circle. plt.axis('equal') diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 1714cc5901c4..bc865aa4fa03 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -1949,7 +1949,10 @@ def draw(self, renderer): self._renderer = renderer if not self.get_visible() or not self._check_xy(renderer): return + # Update text positions before `Text.draw` would, so that the + # FancyArrowPatch is correctly positioned. self.update_positions(renderer) + self.update_bbox_position_size(renderer) if self.arrow_patch is not None: # FancyArrowPatch if self.arrow_patch.figure is None and self.figure is not None: self.arrow_patch.figure = self.figure