def draw(self, renderer):
if renderer is not None:<EOL><INDENT>self._renderer = renderer<EOL><DEDENT>if not self.get_visible(): return<EOL>if self._text=='<STR_LIT>': return<EOL>bbox, info = self._get_layout(renderer)<EOL>trans = self.get_transform()<EOL>posx = float(self.convert_xunits(self._x))<EOL>posy = float(self.convert_yunits(self._y))<EOL>posx, posy = trans.transform_point((posx, posy))<EOL>canvasw, canvash = renderer.get_canvas_width_height()<EOL>if self._bbox_patch:<EOL><INDENT>self._draw_bbox(renderer, posx, posy)<EOL><DEDENT>gc = renderer.new_gc()<EOL>gc.set_foreground(self._color)<EOL>gc.set_alpha(self._alpha)<EOL>gc.set_url(self._url)<EOL>if self.get_clip_on():<EOL><INDENT>gc.set_clip_rectangle(self.clipbox)<EOL><DEDENT>if self._bbox:<EOL><INDENT>bbox_artist(self, renderer, self._bbox)<EOL><DEDENT>angle = self.get_rotation()<EOL>if rcParams['<STR_LIT>']:<EOL><INDENT>for line, wh, x, y in info:<EOL><INDENT>x = x + posx<EOL>y = y + posy<EOL>if renderer.flipy():<EOL><INDENT>y = canvash-y<EOL><DEDENT>clean_line, ismath = self.is_math_text(line)<EOL>renderer.draw_tex(gc, x, y, clean_line,<EOL>self._fontproperties, angle)<EOL><DEDENT>return<EOL><DEDENT>for line, wh, x, y in info:<EOL><INDENT>x = x + posx<EOL>y = y + posy<EOL>if renderer.flipy():<EOL><INDENT>y = canvash-y<EOL><DEDENT>clean_line, ismath = self.is_math_text(line)<EOL>renderer.draw_text(gc, x, y, clean_line,<EOL>self._fontproperties, angle,<EOL>ismath=ismath)<EOL><DEDENT>
Draws the :class:`Text` object to the given *renderer*.