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: Bind the given figure to the tools.
  
  Parameters
  ----------
  figure : `.Figure`
  update_tools : bool, default: True
      Force tools to update figure.
docstr_tok: ["Bind","the","given","figure","to","the","tools",".","Parameters","--","--","--","--","--","figure",":","`",".Figure","`","update_tools",":","bool",",","default",":","True","Force","tools","to","update","figure","."]
code: def set_figure(self, figure, update_tools=True):
      """
      Bind the given figure to the tools.
  
      Parameters
      ----------
      figure : `.Figure`
      update_tools : bool, default: True
          Force tools to update figure.
      """
      if self._key_press_handler_id:
          self.canvas.mpl_disconnect(self._key_press_handler_id)
      self._figure = figure
      if figure:
          self._key_press_handler_id = self.canvas.mpl_connect(
              "key_press_event", self._key_press
          )
      if update_tools:
          for tool in self._tools.values():
              tool.figure = figure
  
imports: from matplotlib import _api, backend_tools, cbook, widgets
label_desc: Use image node_id 5 for calling the ToolManager obj's underlying member method code with example usage: obj.set_figure(figure, update_tools) without return types