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

Skip to content

Commit 44604ce

Browse files
committed
Text class: changed __str__ method to return self._text and added __repr__ method.
1 parent e12d103 commit 44604ce

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/matplotlib/text.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,12 @@ class Text(Artist):
182182

183183
_cached = maxdict(50)
184184

185-
def __str__(self):
185+
def __repr__(self):
186186
return "Text(%g,%g,%s)" % (self._x, self._y, repr(self._text))
187187

188+
def __str__(self):
189+
return self._text
190+
188191
def __init__(self,
189192
x=0, y=0, text='',
190193
color=None, # defaults to rc params

0 commit comments

Comments
 (0)