def get_figure(show, r, figtype, fig_name, theme, title): if title: plt.title(title) if show: plt.show() else: plt.savefig(fig_name+'.'+figtype, format=figtype, bbox_inches='tight', dpi=r) if theme: plt.style.use('default') plt.clf() plt.close()