diff --git a/galleries/examples/text_labels_and_annotations/text_alignment.py b/galleries/examples/text_labels_and_annotations/text_alignment.py index 7ad0d07c6572..4c0351e0bbc5 100644 --- a/galleries/examples/text_labels_and_annotations/text_alignment.py +++ b/galleries/examples/text_labels_and_annotations/text_alignment.py @@ -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 diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 2136ecb2eb94..d07c5103a202 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -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 ---------- diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 6371e03603d6..8734131dddc9 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -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 @@ -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'],