from matplotlib.figure import Figure

def new_fig():
    """Create a new matplotlib figure containing one axis"""
fig = Figure()
FigureCanvas(fig)
ax = fig.add_subplot(111)
return fig, ax
Закрытие рисунков Matplotlib