def new_figure_manager(num, *args, **kwargs):
_focus = windowing.FocusManager()<EOL>FigureClass = kwargs.pop('<STR_LIT>', Figure)<EOL>figure = FigureClass(*args, **kwargs)<EOL>window = Tk.Tk()<EOL>canvas = FigureCanvasTkAgg(figure, master=window)<EOL>figManager = FigureManagerTkAgg(canvas, num, window)<EOL>if matplotlib.is_interactive():<EOL><INDENT>figManager.show()<EOL><DEDENT>return figManager<EOL>
Create a new figure manager instance