class_docstr: Manager for actions triggered by user interactions (key press, toolbar
  clicks, ...) on a Figure.
  
  Attributes
  ----------
  figure : `.Figure`
  keypresslock : `~matplotlib.widgets.LockDraw`
      `.LockDraw` object to know if the `canvas` key_press_event is locked.
  messagelock : `~matplotlib.widgets.LockDraw`
      `.LockDraw` object to know if the message is available to write.
class_docstr_tok: ["Manager","for","actions","triggered","by","user","interactions","(","key","press",",","toolbar","clicks",",","...",")","on","a","Figure",".","Attributes","--","--","--","--","--","figure",":","`",".Figure","`","keypresslock",":","`","~matplotlib.widgets.LockDraw","`","`",".LockDraw","`","object","to","know","if","the","`","canvas","`","key_press_event","is","locked",".","messagelock",":","`","~matplotlib.widgets.LockDraw","`","`",".LockDraw","`","object","to","know","if","the","message","is","available","to","write","."]
docstr: Trigger a tool and emit the ``tool_trigger_{name}`` event.
  
  Parameters
  ----------
  name : str
      Name of the tool.
  sender : object
      Object that wishes to trigger the tool.
  canvasevent : Event
      Original Canvas event or None.
  data : object
      Extra data to pass to the tool when triggering.
docstr_tok: ["Trigger","a","tool","and","emit","the","``","tool_trigger_","{","name","}","``","event",".","Parameters","--","--","--","--","--","name",":","str","Name","of","the","tool",".","sender",":","object","Object","that","wishes","to","trigger","the","tool",".","canvasevent",":","Event","Original","Canvas","event","or","None",".","data",":","object","Extra","data","to","pass","to","the","tool","when","triggering","."]
code: def trigger_tool(
      self, name, sender=None, canvasevent=None, data=None
  ):
      """
      Trigger a tool and emit the ``tool_trigger_{name}`` event.
  
      Parameters
      ----------
      name : str
          Name of the tool.
      sender : object
          Object that wishes to trigger the tool.
      canvasevent : Event
          Original Canvas event or None.
      data : object
          Extra data to pass to the tool when triggering.
      """
      tool = self.get_tool(name)
      if tool is None:
          return
  
      if sender is None:
          sender = self
  
      if isinstance(tool, backend_tools.ToolToggleBase):
          self._handle_toggle(tool, canvasevent, data)
  
      tool.trigger(sender, canvasevent, data)  # Actually trigger Tool.
  
      s = "tool_trigger_%s" % name
      event = ToolTriggerEvent(s, sender, tool, canvasevent, data)
      self._callbacks.process(s, event)
  
imports: from matplotlib import _api, backend_tools, cbook, widgets
label_desc: Use image node_id 16 for calling the ToolManager obj's underlying member method code with example usage: obj.trigger_tool(name, sender, canvasevent, data) without return types