def new_canvas(*args, **kwargs):
 allnums = _pylab_helpers.Gcf.figs.keys()
 num = ((max(allnums) + 1) if allnums else 1)
 FigureClass = kwargs.pop('FigureClass', Figure)
 figure = FigureClass(*args, **kwargs)
 canvas = FigureCanvas(figure)
 fig_manager = FigureManagerQT(canvas, num)
 return fig_manager.canvas

def new_canvas ( * args , ** kwargs ) : allnums = _pylab_helpers . Gcf . figs . keys ( ) num = ( ( max ( allnums ) + 1 ) if allnums else 1 ) FigureClass = kwargs . pop ( 'FigureClass' , Figure ) figure = FigureClass ( * args , ** kwargs ) canvas = FigureCanvas ( figure ) fig_manager = FigureManagerQT ( canvas , num ) return fig_manager . canvas
return a new figure canvas .