class_docstr: A cell is a `.Rectangle` with some associated `.Text`.
  
  As a user, you'll most likely not creates cells yourself. Instead, you
  should use either the `~matplotlib.table.table` factory function or
  `.Table.add_cell`.
class_docstr_tok: ["A","cell","is","a","`",".Rectangle","`","with","some","associated","`",".Text","`",".","As","a","user",",","you","'ll","most","likely","not","creates","cells","yourself",".","Instead",",","you","should","use","either","the","`","~matplotlib.table.table","`","factory","function","or","`",".Table.add_cell","`","."]
docstr: Set text up so it is drawn in the right place.
docstr_tok: ["Set","text","up","so","it","is","drawn","in","the","right","place","."]
code: def _set_text_position(self, renderer):
      """Set text up so it is drawn in the right place."""
      bbox = self.get_window_extent(renderer)
      # center vertically
      y = bbox.y0 + bbox.height / 2
      # position horizontally
      loc = self._text.get_horizontalalignment()
      if loc == "center":
          x = bbox.x0 + bbox.width / 2
      elif loc == "left":
          x = bbox.x0 + bbox.width * self.PAD
      else:  # right.
          x = bbox.x0 + bbox.width * (1 - self.PAD)
      self._text.set_position((x, y))
  
imports: import numpy
  from .None import _api, _docstring
  from .artist import Artist, allow_rasterization
  from .patches import Rectangle
  from .text import Text
  from .transforms import Bbox
  from .path import Path
label_desc: Use image node_id 9 for calling the Cell obj's underlying member method code with example usage: obj._set_text_position(renderer) without return types