class_docstr: Specialized PolyCollection for barbs.
  
  The only API method is :meth:`set_UVC`, which can be used to
  change the size, orientation, and color of the arrows.  Locations
  are changed using the :meth:`set_offsets` collection method.
  Possibly this method will be useful in animations.
  
  There is one internal function :meth:`_find_tails` which finds
  exactly what should be put on the barb given the vector magnitude.
  From there :meth:`_make_barbs` is used to find the vertices of the
  polygon to represent the barb based on this information.
class_docstr_tok: ["Specialized","PolyCollection","for","barbs",".","The","only","API","method","is",":","meth",":","`","set_UVC","`",",","which","can","be","used","to","change","the","size",",","orientation",",","and","color","of","the","arrows",".","Locations","are","changed","using","the",":","meth",":","`","set_offsets","`","collection","method",".","Possibly","this","method","will","be","useful","in","animations",".","There","is","one","internal","function",":","meth",":","`","_find_tails","`","which","finds","exactly","what","should","be","put","on","the","barb","given","the","vector","magnitude",".","From","there",":","meth",":","`","_make_barbs","`","is","used","to","find","the","vertices","of","the","polygon","to","represent","the","barb","based","on","this","information","."]
docstr: Create the wind barbs.
  
  Parameters
  ----------
  u, v
      Components of the vector in the x and y directions, respectively.
  
  nflags, nbarbs, half_barb, empty_flag
      Respectively, the number of flags, number of barbs, flag for
      half a barb, and flag for empty barb, ostensibly obtained from
      :meth:`_find_tails`.
  
  length
      The length of the barb staff in points.
  
  pivot : {"tip", "middle"} or number
      The point on the barb around which the entire barb should be
      rotated.  If a number, the start of the barb is shifted by that
      many points from the origin.
  
  sizes : dict
      Coefficients specifying the ratio of a given feature to the length
      of the barb. These features include:
  
      - *spacing*: space between features (flags, full/half barbs).
      - *height*: distance from shaft of top of a flag or full barb.
      - *width*: width of a flag, twice the width of a full barb.
      - *emptybarb*: radius of the circle used for low magnitudes.
  
  fill_empty : bool
      Whether the circle representing an empty barb should be filled or
      not (this changes the drawing of the polygon).
  
  flip : list of bool
      Whether the features should be flipped to the other side of the
      barb (useful for winds in the southern hemisphere).
  
  Returns
  -------
  list of arrays of vertices
      Polygon vertices for each of the wind barbs.  These polygons have
      been rotated to properly align with the vector direction.
docstr_tok: ["Create","the","wind","barbs",".","Parameters","--","--","--","--","--","u",",","v","Components","of","the","vector","in","the","x","and","y","directions",",","respectively",".","nflags",",","nbarbs",",","half_barb",",","empty_flag","Respectively",",","the","number","of","flags",",","number","of","barbs",",","flag","for","half","a","barb",",","and","flag","for","empty","barb",",","ostensibly","obtained","from",":","meth",":","`","_find_tails","`",".","length","The","length","of","the","barb","staff","in","points",".","pivot",":","{","``","tip","''",",","``","middle","''","}","or","number","The","point","on","the","barb","around","which","the","entire","barb","should","be","rotated",".","If","a","number",",","the","start","of","the","barb","is","shifted","by","that","many","points","from","the","origin",".","sizes",":","dict","Coefficients","specifying","the","ratio","of","a","given","feature","to","the","length","of","the","barb",".","These","features","include",":","-","*","spacing","*",":","space","between","features","(","flags",",","full\/half","barbs",")",".","-","*","height","*",":","distance","from","shaft","of","top","of","a","flag","or","full","barb",".","-","*","width","*",":","width","of","a","flag",",","twice","the","width","of","a","full","barb",".","-","*","emptybarb","*",":","radius","of","the","circle","used","for","low","magnitudes",".","fill_empty",":","bool","Whether","the","circle","representing","an","empty","barb","should","be","filled","or","not","(","this","changes","the","drawing","of","the","polygon",")",".","flip",":","list","of","bool","Whether","the","features","should","be","flipped","to","the","other","side","of","the","barb","(","useful","for","winds","in","the","southern","hemisphere",")",".","Returns","--","--","--","-","list","of","arrays","of","vertices","Polygon","vertices","for","each","of","the","wind","barbs",".","These","polygons","have","been","rotated","to","properly","align","with","the","vector","direction","."]
code: def _make_barbs(
      self,
      u,
      v,
      nflags,
      nbarbs,
      half_barb,
      empty_flag,
      length,
      pivot,
      sizes,
      fill_empty,
      flip,
  ):
      """
      Create the wind barbs.
  
      Parameters
      ----------
      u, v
          Components of the vector in the x and y directions, respectively.
  
      nflags, nbarbs, half_barb, empty_flag
          Respectively, the number of flags, number of barbs, flag for
          half a barb, and flag for empty barb, ostensibly obtained from
          :meth:`_find_tails`.
  
      length
          The length of the barb staff in points.
  
      pivot : {"tip", "middle"} or number
          The point on the barb around which the entire barb should be
          rotated.  If a number, the start of the barb is shifted by that
          many points from the origin.
  
      sizes : dict
          Coefficients specifying the ratio of a given feature to the length
          of the barb. These features include:
  
          - *spacing*: space between features (flags, full/half barbs).
          - *height*: distance from shaft of top of a flag or full barb.
          - *width*: width of a flag, twice the width of a full barb.
          - *emptybarb*: radius of the circle used for low magnitudes.
  
      fill_empty : bool
          Whether the circle representing an empty barb should be filled or
          not (this changes the drawing of the polygon).
  
      flip : list of bool
          Whether the features should be flipped to the other side of the
          barb (useful for winds in the southern hemisphere).
  
      Returns
      -------
      list of arrays of vertices
          Polygon vertices for each of the wind barbs.  These polygons have
          been rotated to properly align with the vector direction.
      """
  
      # These control the spacing and size of barb elements relative to the
      # length of the shaft
      spacing = length * sizes.get("spacing", 0.125)
      full_height = length * sizes.get("height", 0.4)
      full_width = length * sizes.get("width", 0.25)
      empty_rad = length * sizes.get("emptybarb", 0.15)
  
      # Controls y point where to pivot the barb.
      pivot_points = dict(tip=0.0, middle=-length / 2.0)
  
      endx = 0.0
      try:
          endy = float(pivot)
      except ValueError:
          endy = pivot_points[pivot.lower()]
  
      # Get the appropriate angle for the vector components.  The offset is
      # due to the way the barb is initially drawn, going down the y-axis.
      # This makes sense in a meteorological mode of thinking since there 0
      # degrees corresponds to north (the y-axis traditionally)
      angles = -(ma.arctan2(v, u) + np.pi / 2)
  
      # Used for low magnitude.  We just get the vertices, so if we make it
      # out here, it can be reused.  The center set here should put the
      # center of the circle at the location(offset), rather than at the
      # same point as the barb pivot; this seems more sensible.
      circ = CirclePolygon((0, 0), radius=empty_rad).get_verts()
      if fill_empty:
          empty_barb = circ
      else:
          # If we don't want the empty one filled, we make a degenerate
          # polygon that wraps back over itself
          empty_barb = np.concatenate((circ, circ[::-1]))
  
      barb_list = []
      for index, angle in np.ndenumerate(angles):
          # If the vector magnitude is too weak to draw anything, plot an
          # empty circle instead
          if empty_flag[index]:
              # We can skip the transform since the circle has no preferred
              # orientation
              barb_list.append(empty_barb)
              continue
  
          poly_verts = [(endx, endy)]
          offset = length
  
          # Handle if this barb should be flipped
          barb_height = -full_height if flip[index] else full_height
  
          # Add vertices for each flag
          for i in range(nflags[index]):
              # The spacing that works for the barbs is a little to much for
              # the flags, but this only occurs when we have more than 1
              # flag.
              if offset != length:
                  offset += spacing / 2.0
              poly_verts.extend(
                  [
                      [endx, endy + offset],
                      [
                          endx + barb_height,
                          endy - full_width / 2 + offset,
                      ],
                      [endx, endy - full_width + offset],
                  ]
              )
  
              offset -= full_width + spacing
  
          # Add vertices for each barb.  These really are lines, but works
          # great adding 3 vertices that basically pull the polygon out and
          # back down the line
          for i in range(nbarbs[index]):
              poly_verts.extend(
                  [
                      (endx, endy + offset),
                      (
                          endx + barb_height,
                          endy + offset + full_width / 2,
                      ),
                      (endx, endy + offset),
                  ]
              )
  
              offset -= spacing
  
          # Add the vertices for half a barb, if needed
          if half_barb[index]:
              # If the half barb is the first on the staff, traditionally it
              # is offset from the end to make it easy to distinguish from a
              # barb with a full one
              if offset == length:
                  poly_verts.append((endx, endy + offset))
                  offset -= 1.5 * spacing
              poly_verts.extend(
                  [
                      (endx, endy + offset),
                      (
                          endx + barb_height / 2,
                          endy + offset + full_width / 4,
                      ),
                      (endx, endy + offset),
                  ]
              )
  
          # Rotate the barb according the angle. Making the barb first and
          # then rotating it made the math for drawing the barb really easy.
          # Also, the transform framework makes doing the rotation simple.
          poly_verts = (
              transforms.Affine2D().rotate(-angle).transform(poly_verts)
          )
          barb_list.append(poly_verts)
  
      return barb_list
  
imports: import math
  import numpy
  from numpy import ma
  from matplotlib import _api, cbook, _docstring
  import matplotlib.artist
  import matplotlib.collections
  from matplotlib.patches import CirclePolygon
  import matplotlib.text
  import matplotlib.transforms
label_desc: Use image node_id 3 for calling the Barbs obj's underlying member method code with example usage: obj._make_barbs(u, v, nflags, nbarbs, half_barb, empty_flag, length, pivot, sizes, fill_empty, flip) and returns: barb_list