From a79ff866e702ba603de01259c0d1a50838cb8b90 Mon Sep 17 00:00:00 2001 From: Johnny Gill Date: Sun, 11 Mar 2018 13:29:34 -0400 Subject: [PATCH 1/3] make centre_baseline legal for Text.set_verticalalignment --- lib/matplotlib/text.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 82a302c269ed..0ecdf08466e4 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -1147,9 +1147,10 @@ def set_verticalalignment(self, align): """ Set the vertical alignment - ACCEPTS: [ 'center' | 'top' | 'bottom' | 'baseline' ] + ACCEPTS: [ 'center' | 'top' | 'bottom' | 'baseline' | + 'center_baseline' ] """ - legal = ('top', 'bottom', 'center', 'baseline') + legal = ('top', 'bottom', 'center', 'baseline', 'centre_baseline') if align not in legal: raise ValueError('Vertical alignment must be one of %s' % str(legal)) From 81bd65db18f06bd4182ee2e2cce9edb92953563b Mon Sep 17 00:00:00 2001 From: Johnny Gill Date: Sun, 11 Mar 2018 14:31:45 -0400 Subject: [PATCH 2/3] fix Text.__init__() to use set_*alignment methods --- lib/matplotlib/text.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 0ecdf08466e4..ec46e40d751a 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -163,8 +163,8 @@ def __init__(self, self.set_color(color) self.set_usetex(usetex) self.set_wrap(wrap) - self._verticalalignment = verticalalignment - self._horizontalalignment = horizontalalignment + self.set_verticalalignment(verticalalignment) + self.set_horizontalalignment(horizontalalignment) self._multialignment = multialignment self._rotation = rotation self._fontproperties = fontproperties From d7329dff3923a2222f4c058b46fcff01dcc30149 Mon Sep 17 00:00:00 2001 From: Johnny Gill Date: Sun, 11 Mar 2018 15:21:55 -0400 Subject: [PATCH 3/3] US/UK english typo confusion --- lib/matplotlib/text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index ec46e40d751a..2a3c02a17af2 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -1150,7 +1150,7 @@ def set_verticalalignment(self, align): ACCEPTS: [ 'center' | 'top' | 'bottom' | 'baseline' | 'center_baseline' ] """ - legal = ('top', 'bottom', 'center', 'baseline', 'centre_baseline') + legal = ('top', 'bottom', 'center', 'baseline', 'center_baseline') if align not in legal: raise ValueError('Vertical alignment must be one of %s' % str(legal))