code: def new_figure_manager_given_figure(num, figure):
      
      canvas = FigureCanvasAgg(figure)
      manager = FigureManagerBase(canvas, num)
      return manager
docs: Create a new figure manager instance for the given figure.