class_docstr: A path editor.
  
  Press 't' to toggle vertex markers on and off.  When vertex markers are on,
  they can be dragged with the mouse.
class_docstr_tok: ["A","path","editor",".","Press","'t","'","to","toggle","vertex","markers","on","and","off",".","When","vertex","markers","are","on",",","they","can","be","dragged","with","the","mouse","."]
code: def __init__(self, pathpatch):
      self.ax = pathpatch.axes
      canvas = self.ax.figure.canvas
      self.pathpatch = pathpatch
      self.pathpatch.set_animated(True)
  
      x, y = zip(*self.pathpatch.get_path().vertices)
  
      (self.line,) = ax.plot(
          x, y, marker="o", markerfacecolor="r", animated=True
      )
  
      self._ind = None  # the active vertex
  
      canvas.mpl_connect("draw_event", self.on_draw)
      canvas.mpl_connect("button_press_event", self.on_button_press)
      canvas.mpl_connect("key_press_event", self.on_key_press)
      canvas.mpl_connect("button_release_event", self.on_button_release)
      canvas.mpl_connect("motion_notify_event", self.on_mouse_move)
      self.canvas = canvas
  
file_path: matplotlib/galleries/examples/event_handling/path_editor.py
imports: import matplotlib.pyplot
  import numpy
  from matplotlib.backend_bases import MouseButton
  from matplotlib.patches import PathPatch
  from matplotlib.path import Path
label_desc: Use image node_id 1 to create a new PathInteractor object  with example: obj = PathInteractor(pathpatch)