Skip to content

Commit 4e420ca

Browse files
authored
Merge pull request matplotlib#26069 from anntzer/coordsdata
Tweak AnnotationBbox coords specification.
2 parents 4720b6a + 095307f commit 4e420ca

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

galleries/examples/text_labels_and_annotations/demo_text_path.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,7 @@ def draw(self, renderer=None):
113113
offsetbox.add_artist(text_patch)
114114

115115
# place the anchored offset box using AnnotationBbox
116-
ab = AnnotationBbox(offsetbox, (xpos, 0.5),
117-
xycoords='data',
118-
boxcoords="offset points",
119-
box_alignment=(0.5, 0.5),
120-
)
116+
ab = AnnotationBbox(offsetbox, (xpos, 0.5), box_alignment=(0.5, 0.5))
121117

122118
ax2.add_artist(ab)
123119

lib/matplotlib/offsetbox.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,9 +1224,7 @@ def __str__(self):
12241224
return f"AnnotationBbox({self.xy[0]:g},{self.xy[1]:g})"
12251225

12261226
@_docstring.dedent_interpd
1227-
def __init__(self, offsetbox, xy, xybox=None, *,
1228-
xycoords='data',
1229-
boxcoords=None,
1227+
def __init__(self, offsetbox, xy, xybox=None, xycoords='data', boxcoords=None, *,
12301228
frameon=True, pad=0.4, # FancyBboxPatch boxstyle.
12311229
annotation_clip=None,
12321230
box_alignment=(0.5, 0.5),

lib/matplotlib/offsetbox.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ class AnnotationBbox(martist.Artist, mtext._AnnotationBase):
240240
offsetbox: OffsetBox,
241241
xy: tuple[float, float],
242242
xybox: tuple[float, float] | None = ...,
243-
*,
244243
xycoords: str
245244
| tuple[str, str]
246245
| martist.Artist
@@ -252,6 +251,7 @@ class AnnotationBbox(martist.Artist, mtext._AnnotationBase):
252251
| Transform
253252
| Callable[[RendererBase], Bbox | Transform]
254253
| None = ...,
254+
*,
255255
frameon: bool = ...,
256256
pad: float = ...,
257257
annotation_clip: bool | None = ...,

0 commit comments

Comments
 (0)