def save_plot(fig, prefile='<STR_LIT>', postfile='<STR_LIT>', output_path='<STR_LIT>', output_name='<STR_LIT>',<EOL>output_format='<STR_LIT>', dpi=<NUM_LIT>, transparent=False, **_):
if not os.path.exists(output_path):<EOL><INDENT>os.makedirs(output_path)  <EOL><DEDENT>output = os.path.join(output_path,<EOL>prefile + output_name + postfile + "<STR_LIT:.>" + output_format)<EOL>fig.savefig(output, dpi=dpi, transparent=transparent)<EOL>
Generates a figure file in the selected directory.

    Args:
        fig: matplotlib figure
        prefile(str): Include before the general filename of the figure
        postfile(str): Included after the general filename of the figure
        output_path(str): Define the path to the output directory
        output_name(str): String to define the name of the output figure
        output_format(str): String to define the format of the output figure
        dpi(int): Define the DPI (Dots per Inch) of the figure
        transparent(bool): If True the saved figure will have a transparent background