class_docstr: Sankey diagram in matplotlib
  
    Sankey diagrams are a specific type of flow diagram, in which
    the width of the arrows is shown proportionally to the flow
    quantity.  They are typically used to visualize energy or
    material or cost transfers between processes.
    `Wikipedia (6/1/2011) <https://en.wikipedia.org/wiki/Sankey_diagram>`_
class_docstr_tok: ["Sankey","diagram","in","matplotlib","Sankey","diagrams","are","a","specific","type","of","flow","diagram",",","in","which","the","width","of","the","arrows","is","shown","proportionally","to","the","flow","quantity",".","They","are","typically","used","to","visualize","energy","or","material","or","cost","transfers","between","processes",".","`","Wikipedia","(","6\/1\/2011",")","<","https",":","\/\/en.wikipedia.org\/wiki\/Sankey_diagram",">","`","_"]
docstr: Append an output to a path and return its tip and label locations.
  
  .. note:: *flow* is negative for an output.
docstr_tok: ["Append","an","output","to","a","path","and","return","its","tip","and","label","locations",".","..","note",":",":","*","flow","*","is","negative","for","an","output","."]
code: def _add_output(self, path, angle, flow, length):
      """
      Append an output to a path and return its tip and label locations.
  
      .. note:: *flow* is negative for an output.
      """
      if angle is None:
          return [0, 0], [0, 0]
      else:
          x, y = path[-1][1]  # Use the last point as a reference.
          tipheight = (self.shoulder - flow / 2) * self.pitch
          if angle == RIGHT:
              x += length
              tip = [x + tipheight, y + flow / 2.0]
              path.extend(
                  [
                      (Path.LINETO, [x, y]),
                      (Path.LINETO, [x, y + self.shoulder]),
                      (Path.LINETO, tip),
                      (Path.LINETO, [x, y - self.shoulder + flow]),
                      (Path.LINETO, [x, y + flow]),
                      (Path.LINETO, [x - self.gap, y + flow]),
                  ]
              )
              label_location = [tip[0] + self.offset, tip[1]]
          else:  # Vertical
              x += self.gap
              if angle == UP:
                  sign = 1
              else:
                  sign = -1
  
              tip = [x - flow / 2.0, y + sign * (length + tipheight)]
              if angle == UP:
                  quadrant = 3
              else:
                  quadrant = 0
              # Inner arc isn't needed if inner radius is zero
              if self.radius:
                  path.extend(
                      self._arc(
                          quadrant=quadrant,
                          cw=angle == UP,
                          radius=self.radius,
                          center=(
                              x - self.radius,
                              y + sign * self.radius,
                          ),
                      )
                  )
              else:
                  path.append((Path.LINETO, [x, y]))
              path.extend(
                  [
                      (Path.LINETO, [x, y + sign * length]),
                      (
                          Path.LINETO,
                          [x - self.shoulder, y + sign * length],
                      ),
                      (Path.LINETO, tip),
                      (
                          Path.LINETO,
                          [x + self.shoulder - flow, y + sign * length],
                      ),
                      (Path.LINETO, [x - flow, y + sign * length]),
                  ]
              )
              path.extend(
                  self._arc(
                      quadrant=quadrant,
                      cw=angle == DOWN,
                      radius=self.radius - flow,
                      center=(x - self.radius, y + sign * self.radius),
                  )
              )
              path.append((Path.LINETO, [x - flow, y + sign * flow]))
              label_location = [tip[0], tip[1] + sign * self.offset]
          return tip, label_location
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  import logging
  from six.moves import zip
  import numpy
  from matplotlib.cbook import iterable, Bunch
  from matplotlib.path import Path
  from matplotlib.patches import PathPatch
  from matplotlib.transforms import Affine2D
  from matplotlib import docstring
  from matplotlib import rcParams
label_desc: Use image node_id 4 for calling the Sankey obj's underlying member method code with example usage: obj._add_output(path, angle, flow, length) and returns: list,  list, tip,  label_location