class_docstr: A strip
  
  This class exists to have in one place all that is required to draw
  strip text onto an axes. As Matplotlib does not have a layout manager
  that makes it easy to adorn an axes with artists, we have to compute
  the space required for the text and the background strip on which it
  is drawn. This is very finicky and fails once the facets become
  complicated.
class_docstr_tok: ["A","strip","This","class","exists","to","have","in","one","place","all","that","is","required","to","draw","strip","text","onto","an","axes",".","As","Matplotlib","does","not","have","a","layout","manager","that","makes","it","easy","to","adorn","an","axes","with","artists",",","we","have","to","compute","the","space","required","for","the","text","and","the","background","strip","on","which","it","is","drawn",".","This","is","very","finicky","and","fails","once","the","facets","become","complicated","."]
docstr: Get information required to draw strips
  
  Returns
  -------
  out :
      A structure with all the coordinates (x, y) required
      to draw the strip text and the background box
      (box_x, box_y, box_width, box_height).
docstr_tok: ["Get","information","required","to","draw","strips","Returns","--","--","--","-","out",":","A","structure","with","all","the","coordinates","(","x",",","y",")","required","to","draw","the","strip","text","and","the","background","box","(","box_x",",","box_y",",","box_width",",","box_height",")","."]
code: def get_draw_info(self) -> strip_draw_info:
      """
      Get information required to draw strips
  
      Returns
      -------
      out :
          A structure with all the coordinates (x, y) required
          to draw the strip text and the background box
          (box_x, box_y, box_width, box_height).
      """
      _property = self.theme.themeables.property
      position = self.position
      if position == "top":
          # The x & y values are just starting locations
          # The final location is determined by the layout manager.
          x, y = 0, 1
          ha, va = "center", "bottom"
          rotation = _property("strip_text_x", "rotation")
          box_width = 1
          box_height = 0  # Determined by the text size
          # TODO: Allow two unique paddings for either side.
          # Requires implementing an mpl.patches.boxstyle that recognises
          # two padding values.
          strip_text_margin = _property(
              "strip_text_x", "margin"
          ).get_as("b", "lines")
          strip_align = _property("strip_align_x")
  
          # x & width properties of the background slide and
          # shrink the strip horizontally.
          with suppress(KeyError):
              x = _property("strip_text_x", "x")
          with suppress(KeyError):
              box_width = _property("strip_background_x", "width")
  
      elif position == "right":
          # The x & y values are just starting locations
          # The final location is determined by the layout manager.
          x, y = 1, 0
          ha, va = "left", "center"
          rotation = _property("strip_text_y", "rotation")
          box_width = 0  # Determine by the text height
          box_height = 1
          # TODO: Allow two unique paddings for either side.
          # Requires implementing an mpl.patches.boxstyle that recognises
          # two padding values.
          strip_text_margin = _property(
              "strip_text_y", "margin"
          ).get_as("r", "lines")
          strip_align = _property("strip_align_y")
  
          # y & height properties of the background slide and
          # shrink the strip vertically.
          with suppress(KeyError):
              y = _property("strip_text_y", "y")
          with suppress(KeyError):
              box_height = _property("strip_background_y", "height")
      else:
          raise ValueError(
              f"Unknown position for strip text: {position!r}"
          )
  
      return strip_draw_info(
          x=x,
          y=y,
          ha=ha,
          va=va,
          box_width=box_width,
          box_height=box_height,
          strip_text_margin=strip_text_margin,
          strip_align=strip_align,
          position=position,
          label=self.label_info.text(),
          ax=self.ax,
          rotation=rotation,
      )
  
file_path: plotnine/plotnine/facets/strips.py
imports: from __future__ import annotations
  import typing
  from contextlib import suppress
  from typing import List
  from ..iapi import strip_draw_info, strip_label_details
label_desc: Use image node_id 2 for calling the strip obj's underlying member method code with example usage: obj.get_draw_info() and returns: strip_draw_info