class_docstr: an axis spine -- the line noting the data area boundaries
  
  Spines are the lines connecting the axis tick marks and noting the
  boundaries of the data area. They can be placed at arbitrary
  positions. See function:`~matplotlib.spines.Spine.set_position`
  for more information.
  
  The default position is ``('outward',0)``.
  
  Spines are subclasses of class:`~matplotlib.patches.Patch`, and
  inherit much of their behavior.
  
  Spines draw a line, a circle, or an arc depending if
  function:`~matplotlib.spines.Spine.set_patch_line`,
  function:`~matplotlib.spines.Spine.set_patch_circle`, or
  function:`~matplotlib.spines.Spine.set_patch_arc` has been called.
  Line-like is the default.
docstr: calculate the offset transform performed by the spine
code: def _calc_offset_transform(self):
      """calculate the offset transform performed by the spine"""
      self._ensure_position_is_set()
      position = self._position
      if isinstance(position, six.string_types):
          if position == "center":
              position = ("axes", 0.5)
          elif position == "zero":
              position = ("data", 0)
      assert len(position) == 2, "position should be 2-tuple"
      position_type, amount = position
      assert position_type in ("axes", "outward", "data")
      if position_type == "outward":
          if amount == 0:
              # short circuit commonest case
              self._spine_transform = (
                  "identity",
                  mtransforms.IdentityTransform(),
              )
          elif self.spine_type in ["left", "right", "top", "bottom"]:
              offset_vec = {
                  "left": (-1, 0),
                  "right": (1, 0),
                  "bottom": (0, -1),
                  "top": (0, 1),
              }[self.spine_type]
              # calculate x and y offset in dots
              offset_x = amount * offset_vec[0] / 72.0
              offset_y = amount * offset_vec[1] / 72.0
              self._spine_transform = (
                  "post",
                  mtransforms.ScaledTranslation(
                      offset_x, offset_y, self.figure.dpi_scale_trans
                  ),
              )
          else:
              warnings.warn(
                  'unknown spine type "%s": no spine '
                  "offset performed" % self.spine_type
              )
              self._spine_transform = (
                  "identity",
                  mtransforms.IdentityTransform(),
              )
      elif position_type == "axes":
          if self.spine_type in ("left", "right"):
              self._spine_transform = (
                  "pre",
                  mtransforms.Affine2D.from_values(
                      # keep y unchanged, fix x at
                      # amount
                      0,
                      0,
                      0,
                      1,
                      amount,
                      0,
                  ),
              )
          elif self.spine_type in ("bottom", "top"):
              self._spine_transform = (
                  "pre",
                  mtransforms.Affine2D.from_values(
                      # keep x unchanged, fix y at
                      # amount
                      1,
                      0,
                      0,
                      0,
                      0,
                      amount,
                  ),
              )
          else:
              warnings.warn(
                  'unknown spine type "%s": no spine '
                  "offset performed" % self.spine_type
              )
              self._spine_transform = (
                  "identity",
                  mtransforms.IdentityTransform(),
              )
      elif position_type == "data":
          if self.spine_type in ("right", "top"):
              # The right and top spines have a default position of 1 in
              # axes coordinates.  When specifying the position in data
              # coordinates, we need to calculate the position relative to 0.
              amount -= 1
          if self.spine_type in ("left", "right"):
              self._spine_transform = (
                  "data",
                  mtransforms.Affine2D().translate(amount, 0),
              )
          elif self.spine_type in ("bottom", "top"):
              self._spine_transform = (
                  "data",
                  mtransforms.Affine2D().translate(0, amount),
              )
          else:
              warnings.warn(
                  'unknown spine type "%s": no spine '
                  "offset performed" % self.spine_type
              )
              self._spine_transform = (
                  "identity",
                  mtransforms.IdentityTransform(),
              )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  import matplotlib
  from matplotlib.artist import allow_rasterization
  from matplotlib import docstring
  import matplotlib.transforms
  import matplotlib.patches
  import matplotlib.path
  import numpy
  import warnings
label_desc: Use image node_id 17 for calling the Spine obj's underlying member method code with example usage: obj._calc_offset_transform() without return types