Skip to content

Commit a853407

Browse files
authored
Merge pull request matplotlib#22580 from trichter/fix_doc_annotation_clip
fix doc for annotation_clip parameter
2 parents 09b17b1 + fa983c0 commit a853407

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

lib/matplotlib/patches.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4694,18 +4694,16 @@ def _get_xy(self, xy, s, axes=None):
46944694

46954695
def set_annotation_clip(self, b):
46964696
"""
4697-
Set the clipping behavior.
4697+
Set the annotation's clipping behavior.
46984698
46994699
Parameters
47004700
----------
47014701
b : bool or None
4702-
4703-
- *False*: The annotation will always be drawn regardless of its
4704-
position.
4705-
- *True*: The annotation will only be drawn if ``self.xy`` is
4706-
inside the axes.
4707-
- *None*: The annotation will only be drawn if ``self.xy`` is
4708-
inside the axes and ``self.xycoords == "data"``.
4702+
- True: The annotation will be clipped when ``self.xy`` is
4703+
outside the axes.
4704+
- False: The annotation will always be drawn.
4705+
- None: The annotation will be clipped when ``self.xy`` is
4706+
outside the axes and ``self.xycoords == "data"``.
47094707
"""
47104708
self._annotation_clip = b
47114709
self.stale = True

lib/matplotlib/text.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,12 +1532,11 @@ def set_annotation_clip(self, b):
15321532
Parameters
15331533
----------
15341534
b : bool or None
1535-
- True: the annotation will only be drawn when ``self.xy`` is
1536-
inside the axes.
1537-
- False: the annotation will always be drawn regardless of its
1538-
position.
1539-
- None: the ``self.xy`` will be checked only if *xycoords* is
1540-
"data".
1535+
- True: The annotation will be clipped when ``self.xy`` is
1536+
outside the axes.
1537+
- False: The annotation will always be drawn.
1538+
- None: The annotation will be clipped when ``self.xy`` is
1539+
outside the axes and ``self.xycoords == "data"``.
15411540
"""
15421541
self._annotation_clip = b
15431542

@@ -1767,14 +1766,14 @@ def transform(renderer) -> Transform
17671766
centered in the text box.
17681767
17691768
annotation_clip : bool or None, default: None
1770-
Whether to draw the annotation when the annotation point *xy* is
1771-
outside the axes area.
1769+
Whether to clip (i.e. not draw) the annotation when the annotation
1770+
point *xy* is outside the axes area.
17721771
1773-
- If *True*, the annotation will only be drawn when *xy* is
1774-
within the axes.
1772+
- If *True*, the annotation will be clipped when *xy* is outside
1773+
the axes.
17751774
- If *False*, the annotation will always be drawn.
1776-
- If *None*, the annotation will only be drawn when *xy* is
1777-
within the axes and *xycoords* is 'data'.
1775+
- If *None*, the annotation will be clipped when *xy* is outside
1776+
the axes and *xycoords* is 'data'.
17781777
17791778
**kwargs
17801779
Additional kwargs are passed to `~matplotlib.text.Text`.

0 commit comments

Comments
 (0)