| 1337 | return "TextWithDash(%g, %g, %r)" % (self._x, self._y, self._text) |
| 1338 | |
| 1339 | def __init__(self, |
| 1340 | x=0, y=0, text='', |
| 1341 | color=None, # defaults to rc params |
| 1342 | verticalalignment='center', |
| 1343 | horizontalalignment='center', |
| 1344 | multialignment=None, |
| 1345 | fontproperties=None, # defaults to FontProperties() |
| 1346 | rotation=None, |
| 1347 | linespacing=None, |
| 1348 | dashlength=0.0, |
| 1349 | dashdirection=0, |
| 1350 | dashrotation=None, |
| 1351 | dashpad=3, |
| 1352 | dashpush=0, |
| 1353 | ): |
| 1354 | |
| 1355 | Text.__init__(self, x=x, y=y, text=text, color=color, |
| 1356 | verticalalignment=verticalalignment, |
| 1357 | horizontalalignment=horizontalalignment, |
| 1358 | multialignment=multialignment, |
| 1359 | fontproperties=fontproperties, |
| 1360 | rotation=rotation, |
| 1361 | linespacing=linespacing) |
| 1362 | |
| 1363 | # The position (x,y) values for text and dashline |
| 1364 | # are bogus as given in the instantiation; they will |
| 1365 | # be set correctly by update_coords() in draw() |
| 1366 | |
| 1367 | self.dashline = Line2D(xdata=(x, x), |
| 1368 | ydata=(y, y), |
| 1369 | color='k', |
| 1370 | linestyle='-') |
| 1371 | |
| 1372 | self._dashx = float(x) |
| 1373 | self._dashy = float(y) |
| 1374 | self._dashlength = dashlength |
| 1375 | self._dashdirection = dashdirection |
| 1376 | self._dashrotation = dashrotation |
| 1377 | self._dashpad = dashpad |
| 1378 | self._dashpush = dashpush |
| 1379 | |
| 1380 | #self.set_bbox(dict(pad=0)) |
| 1381 | |
| 1382 | def get_unitless_position(self): |
| 1383 | "Return the unitless position of the text as a tuple (*x*, *y*)" |