Skip to content

Commit 8af1fac

Browse files
authored
Merge pull request #10751 from swfiua/cb
make centre_baseline legal for Text.set_verticalalignment
2 parents ccd6377 + d7329df commit 8af1fac

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/matplotlib/text.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ def __init__(self,
163163
self.set_color(color)
164164
self.set_usetex(usetex)
165165
self.set_wrap(wrap)
166-
self._verticalalignment = verticalalignment
167-
self._horizontalalignment = horizontalalignment
166+
self.set_verticalalignment(verticalalignment)
167+
self.set_horizontalalignment(horizontalalignment)
168168
self._multialignment = multialignment
169169
self._rotation = rotation
170170
self._fontproperties = fontproperties
@@ -1147,9 +1147,10 @@ def set_verticalalignment(self, align):
11471147
"""
11481148
Set the vertical alignment
11491149
1150-
ACCEPTS: [ 'center' | 'top' | 'bottom' | 'baseline' ]
1150+
ACCEPTS: [ 'center' | 'top' | 'bottom' | 'baseline' |
1151+
'center_baseline' ]
11511152
"""
1152-
legal = ('top', 'bottom', 'center', 'baseline')
1153+
legal = ('top', 'bottom', 'center', 'baseline', 'center_baseline')
11531154
if align not in legal:
11541155
raise ValueError('Vertical alignment must be one of %s' %
11551156
str(legal))

0 commit comments

Comments
 (0)