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

Skip to content

Commit ad94c82

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 813d842 commit ad94c82

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
@@ -127,14 +127,13 @@ def _get_textbox(text, renderer):
127127

128128

129129
class Text(Artist):
130-
"""
131-
Handle storing and drawing of text in window or data coordinates.
132-
"""
130+
"""Handle storing and drawing of text in window or data coordinates."""
131+
133132
zorder = 3
134133
_cached = maxdict(50)
135134

136135
def __repr__(self):
137-
return "Text(%g,%g,%s)" % (self._x, self._y, repr(self._text))
136+
return "Text(%g, %g, %r)" % (self._x, self._y, self._text)
138137

139138
def __init__(self,
140139
x=0, y=0, text='',
@@ -151,8 +150,7 @@ def __init__(self,
151150
**kwargs
152151
):
153152
"""
154-
Create a :class:`~matplotlib.text.Text` instance at *x*, *y*
155-
with string *text*.
153+
Create a `Text` instance at *x*, *y* with string *text*.
156154
157155
Valid kwargs are
158156
%(Text)s

0 commit comments

Comments
 (0)