import pathlib


def _init_plot_file(outputfolder, to_plot, format):
    """Initializes the plot file. """
    pathlib.Path(outputfolder).mkdir(parents=True, exist_ok=True)
    outputpath = outputfolder + '{}.{}'.format(to_plot, format)
    return outputpath