class_docstr: A line-based PathEffect which draws a path with a ticked style.
  
  This line style is frequently used to represent constraints in
  optimization.  The ticks may be used to indicate that one side
  of the line is invalid or to represent a closed boundary of a
  domain (i.e. a wall or the edge of a pipe).
  
  The spacing, length, and angle of ticks can be controlled.
  
  This line style is sometimes referred to as a hatched line.
  
  See also the :doc:`/gallery/misc/tickedstroke_demo` example.
class_docstr_tok: ["A","line-based","PathEffect","which","draws","a","path","with","a","ticked","style",".","This","line","style","is","frequently","used","to","represent","constraints","in","optimization",".","The","ticks","may","be","used","to","indicate","that","one","side","of","the","line","is","invalid","or","to","represent","a","closed","boundary","of","a","domain","(","i.e",".","a","wall","or","the","edge","of","a","pipe",")",".","The","spacing",",","length",",","and","angle","of","ticks","can","be","controlled",".","This","line","style","is","sometimes","referred","to","as","a","hatched","line",".","See","also","the",":","doc",":","`","\/gallery\/misc\/tickedstroke_demo","`","example","."]
docstr: Draw the path with updated gc.
code: def draw_path(self, renderer, gc, tpath, affine, rgbFace):
      """Draw the path with updated gc."""
      # Do not modify the input! Use copy instead.
      gc0 = renderer.new_gc()
      gc0.copy_properties(gc)
  
      gc0 = self._update_gc(gc0, self._gc)
      trans = affine + self._offset_transform(renderer)
  
      theta = -np.radians(self._angle)
      trans_matrix = np.array(
          [
              [np.cos(theta), -np.sin(theta)],
              [np.sin(theta), np.cos(theta)],
          ]
      )
  
      # Convert spacing parameter to pixels.
      spacing_px = renderer.points_to_pixels(self._spacing)
  
      # Transform before evaluation because to_polygons works at resolution
      # of one -- assuming it is working in pixel space.
      transpath = affine.transform_path(tpath)
  
      # Evaluate path to straight line segments that can be used to
      # construct line ticks.
      polys = transpath.to_polygons(closed_only=False)
  
      for p in polys:
          x = p[:, 0]
          y = p[:, 1]
  
          # Can not interpolate points or draw line if only one point in
          # polyline.
          if x.size < 2:
              continue
  
          # Find distance between points on the line
          ds = np.hypot(x[1:] - x[:-1], y[1:] - y[:-1])
  
          # Build parametric coordinate along curve
          s = np.concatenate(([0.0], np.cumsum(ds)))
          s_total = s[-1]
  
          num = int(np.ceil(s_total / spacing_px)) - 1
          # Pick parameter values for ticks.
          s_tick = np.linspace(
              spacing_px / 2, s_total - spacing_px / 2, num
          )
  
          # Find points along the parameterized curve
          x_tick = np.interp(s_tick, s, x)
          y_tick = np.interp(s_tick, s, y)
  
          # Find unit vectors in local direction of curve
          delta_s = self._spacing * 0.001
          u = (np.interp(s_tick + delta_s, s, x) - x_tick) / delta_s
          v = (np.interp(s_tick + delta_s, s, y) - y_tick) / delta_s
  
          # Normalize slope into unit slope vector.
          n = np.hypot(u, v)
          mask = n == 0
          n[mask] = 1.0
  
          uv = np.array([u / n, v / n]).T
          uv[mask] = np.array([0, 0]).T
  
          # Rotate and scale unit vector into tick vector
          dxy = np.dot(uv, trans_matrix) * self._length * spacing_px
  
          # Build tick endpoints
          x_end = x_tick + dxy[:, 0]
          y_end = y_tick + dxy[:, 1]
  
          # Interleave ticks to form Path vertices
          xyt = np.empty((2 * num, 2), dtype=x_tick.dtype)
          xyt[0::2, 0] = x_tick
          xyt[1::2, 0] = x_end
          xyt[0::2, 1] = y_tick
          xyt[1::2, 1] = y_end
  
          # Build up vector of Path codes
          codes = np.tile([Path.MOVETO, Path.LINETO], num)
  
          # Construct and draw resulting path
          h = Path(xyt, codes)
          # Transform back to data space during render
          renderer.draw_path(gc0, h, affine.inverted() + trans, rgbFace)
  
      gc0.restore()
  
imports: from matplotlib.backend_bases import RendererBase
  from matplotlib import colors
  from matplotlib import patches
  from matplotlib import transforms
  from matplotlib.path import Path
  import numpy
label_desc: Use image node_id 2 for calling the TickedStroke obj's underlying member method code with example usage: obj.draw_path(renderer, gc, tpath, affine, rgbFace) without return types