Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3797bd8

Browse files
committed
Minor cleanup to Text class.
1. Remove some unneeded newlines in the class docstring. 2. Add a space after commas in the repr. 3. Make the constructor docstring's first sentence fit in one line.
1 parent fb4b612 commit 3797bd8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/matplotlib/text.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,13 @@ def _get_textbox(text, renderer):
125125
"weight": ["fontweight"],
126126
})
127127
class Text(Artist):
128-
"""
129-
Handle storing and drawing of text in window or data coordinates.
130-
"""
128+
"""Handle storing and drawing of text in window or data coordinates."""
129+
131130
zorder = 3
132131
_cached = cbook.maxdict(50)
133132

134133
def __repr__(self):
135-
return "Text(%g,%g,%s)" % (self._x, self._y, repr(self._text))
134+
return "Text(%g, %g, %r)" % (self._x, self._y, self._text)
136135

137136
def __init__(self,
138137
x=0, y=0, text='',
@@ -149,8 +148,7 @@ def __init__(self,
149148
**kwargs
150149
):
151150
"""
152-
Create a :class:`~matplotlib.text.Text` instance at *x*, *y*
153-
with string *text*.
151+
Create a `Text` instance at *x*, *y* with string *text*.
154152
155153
Valid kwargs are
156154
%(Text)s

0 commit comments

Comments
 (0)