Skip to content

Commit

Permalink
Merge pull request #27510 from meeseeksmachine/auto-backport-of-pr-27…
Browse files Browse the repository at this point in the history
…346-on-v3.8.x

Backport PR #27346 on branch v3.8.x (DOC: Show and correct default alignment parameters in text.py)
  • Loading branch information
rcomer committed Dec 13, 2023
2 parents 93a8cfe + bce5d1a commit b63a5cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
==============
Texts are aligned relative to their anchor point depending on the properties
``horizontalalignment`` and ``verticalalignment``.
``horizontalalignment`` (default: ``left``) and ``verticalalignment``
(default: ``baseline``.)
.. redirect-from:: /gallery/pyplots/text_layout
Expand Down
5 changes: 4 additions & 1 deletion lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,10 @@ def text(self, x, y, s, fontdict=None, **kwargs):
"""
Add text to the Axes.
Add the text *s* to the Axes at location *x*, *y* in data coordinates.
Add the text *s* to the Axes at location *x*, *y* in data coordinates,
with a default ``horizontalalignment`` on the ``left`` and
``verticalalignment`` at the ``baseline``. See
:doc:`/gallery/text_labels_and_annotations/text_alignment`.
Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(self,
The text is aligned relative to the anchor point (*x*, *y*) according
to ``horizontalalignment`` (default: 'left') and ``verticalalignment``
(default: 'bottom'). See also
(default: 'baseline'). See also
:doc:`/gallery/text_labels_and_annotations/text_alignment`.
While Text accepts the 'label' keyword argument, by default it is not
Expand Down Expand Up @@ -1251,7 +1251,7 @@ def set_verticalalignment(self, align):
Parameters
----------
align : {'bottom', 'baseline', 'center', 'center_baseline', 'top'}
align : {'baseline', 'bottom', 'center', 'center_baseline', 'top'}
"""
_api.check_in_list(
['top', 'bottom', 'center', 'baseline', 'center_baseline'],
Expand Down

0 comments on commit b63a5cb

Please sign in to comment.