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