MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / draw_text

Method draw_text

lib/matplotlib/backends/backend_svg.py:1281–1302  ·  view source on GitHub ↗
(self, gc, x, y, s, prop, angle, ismath=False, mtext=None)

Source from the content-addressed store, hash-verified

1279 writer.end('g')
1280
1281 def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
1282 # docstring inherited
1283
1284 clip_attrs = self._get_clip_attrs(gc)
1285 if clip_attrs:
1286 # Cannot apply clip-path directly to the text, because
1287 # it has a transformation
1288 self.writer.start('g', **clip_attrs)
1289
1290 if gc.get_url() is not None:
1291 self.writer.start('a', {'xlink:href': gc.get_url(), 'target': '_blank'})
1292
1293 if mpl.rcParams['svg.fonttype'] == 'path':
1294 self._draw_text_as_path(gc, x, y, s, prop, angle, ismath, mtext)
1295 else:
1296 self._draw_text_as_text(gc, x, y, s, prop, angle, ismath, mtext)
1297
1298 if gc.get_url() is not None:
1299 self.writer.end('a')
1300
1301 if clip_attrs:
1302 self.writer.end('g')
1303
1304 def flipy(self):
1305 # docstring inherited

Callers

nothing calls this directly

Calls 6

_get_clip_attrsMethod · 0.95
_draw_text_as_pathMethod · 0.95
_draw_text_as_textMethod · 0.95
startMethod · 0.45
get_urlMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected