diff --git a/galleries/examples/text_labels_and_annotations/demo_text_path.py b/galleries/examples/text_labels_and_annotations/demo_text_path.py index 945ff7067ba0..427a4fd69a9f 100644 --- a/galleries/examples/text_labels_and_annotations/demo_text_path.py +++ b/galleries/examples/text_labels_and_annotations/demo_text_path.py @@ -113,11 +113,7 @@ def draw(self, renderer=None): offsetbox.add_artist(text_patch) # place the anchored offset box using AnnotationBbox - ab = AnnotationBbox(offsetbox, (xpos, 0.5), - xycoords='data', - boxcoords="offset points", - box_alignment=(0.5, 0.5), - ) + ab = AnnotationBbox(offsetbox, (xpos, 0.5), box_alignment=(0.5, 0.5)) ax2.add_artist(ab) diff --git a/lib/matplotlib/offsetbox.py b/lib/matplotlib/offsetbox.py index c2c0e54caca0..6b3ed4f42557 100644 --- a/lib/matplotlib/offsetbox.py +++ b/lib/matplotlib/offsetbox.py @@ -1224,9 +1224,7 @@ def __str__(self): return f"AnnotationBbox({self.xy[0]:g},{self.xy[1]:g})" @_docstring.dedent_interpd - def __init__(self, offsetbox, xy, xybox=None, *, - xycoords='data', - boxcoords=None, + def __init__(self, offsetbox, xy, xybox=None, xycoords='data', boxcoords=None, *, frameon=True, pad=0.4, # FancyBboxPatch boxstyle. annotation_clip=None, box_alignment=(0.5, 0.5), diff --git a/lib/matplotlib/offsetbox.pyi b/lib/matplotlib/offsetbox.pyi index 3a4c23e9124b..a6027c3a2e8c 100644 --- a/lib/matplotlib/offsetbox.pyi +++ b/lib/matplotlib/offsetbox.pyi @@ -240,7 +240,6 @@ class AnnotationBbox(martist.Artist, mtext._AnnotationBase): offsetbox: OffsetBox, xy: tuple[float, float], xybox: tuple[float, float] | None = ..., - *, xycoords: str | tuple[str, str] | martist.Artist @@ -252,6 +251,7 @@ class AnnotationBbox(martist.Artist, mtext._AnnotationBase): | Transform | Callable[[RendererBase], Bbox | Transform] | None = ..., + *, frameon: bool = ..., pad: float = ..., annotation_clip: bool | None = ...,