def plot_periodbase_lsp(lspinfo, outfile=None, plotdpi=<NUM_LIT:100>):
<EOL>if isinstance(lspinfo,str) and os.path.exists(lspinfo):<EOL><INDENT>LOGINFO('<STR_LIT>' % lspinfo)<EOL>with open(lspinfo,'<STR_LIT:rb>') as infd:<EOL><INDENT>lspinfo = pickle.load(infd)<EOL><DEDENT><DEDENT>try:<EOL><INDENT>periods = lspinfo['<STR_LIT>']<EOL>lspvals = lspinfo['<STR_LIT>']<EOL>bestperiod = lspinfo['<STR_LIT>']<EOL>lspmethod = lspinfo['<STR_LIT>']<EOL>plt.plot(periods, lspvals)<EOL>plt.xscale('<STR_LIT>',basex=<NUM_LIT:10>)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel(PLOTYLABELS[lspmethod])<EOL>plottitle = '<STR_LIT>' % (METHODSHORTLABELS[lspmethod],<EOL>bestperiod)<EOL>plt.title(plottitle)<EOL>for bestperiod, bestpeak in zip(lspinfo['<STR_LIT>'],<EOL>lspinfo['<STR_LIT>']):<EOL><INDENT>plt.annotate('<STR_LIT>' % bestperiod,<EOL>xy=(bestperiod, bestpeak), xycoords='<STR_LIT:data>',<EOL>xytext=(<NUM_LIT:0.0>,<NUM_LIT>), textcoords='<STR_LIT>',<EOL>arrowprops=dict(arrowstyle="<STR_LIT>"),fontsize='<STR_LIT>')<EOL><DEDENT>plt.grid(color='<STR_LIT>',<EOL>alpha=<NUM_LIT>,<EOL>zorder=<NUM_LIT:0>,<EOL>linewidth=<NUM_LIT:1.0>,<EOL>linestyle='<STR_LIT::>')<EOL>if outfile and isinstance(outfile, str):<EOL><INDENT>if outfile.endswith('<STR_LIT>'):<EOL><INDENT>plt.savefig(outfile,bbox_inches='<STR_LIT>',dpi=plotdpi)<EOL><DEDENT>else:<EOL><INDENT>plt.savefig(outfile,bbox_inches='<STR_LIT>')<EOL><DEDENT>plt.close()<EOL>return os.path.abspath(outfile)<EOL><DEDENT>elif dispok:<EOL><INDENT>plt.show()<EOL>plt.close()<EOL>return<EOL><DEDENT>else:<EOL><INDENT>LOGWARNING('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>outfile = '<STR_LIT>'<EOL>plt.savefig(outfile,bbox_inches='<STR_LIT>',dpi=plotdpi)<EOL>plt.close()<EOL>return os.path.abspath(outfile)<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>LOGEXCEPTION('<STR_LIT>')<EOL>return<EOL><DEDENT>
Makes a plot of periodograms obtained from `periodbase` functions.

    This takes the output dict produced by any `astrobase.periodbase`
    period-finder function or a pickle filename containing such a dict and makes
    a periodogram plot.

    Parameters
    ----------

    lspinfo : dict or str
        If lspinfo is a dict, it must be a dict produced by an
        `astrobase.periodbase` period-finder function or a dict from your own
        period-finder function or routine that is of the form below with at
        least these keys::

            {'periods': np.array of all periods searched by the period-finder,
             'lspvals': np.array of periodogram power value for each period,
             'bestperiod': a float value that is the period with the highest
                           peak in the periodogram, i.e. the most-likely actual
                           period,
             'method': a three-letter code naming the period-finder used; must
                       be one of the keys in the `METHODLABELS` dict above,
             'nbestperiods': a list of the periods corresponding to periodogram
                             peaks (`nbestlspvals` below) to annotate on the
                             periodogram plot so they can be called out
                             visually,
             'nbestlspvals': a list of the power values associated with
                             periodogram peaks to annotate on the periodogram
                             plot so they can be called out visually; should be
                             the same length as `nbestperiods` above}

        If lspinfo is a str, then it must be a path to a pickle file that
        contains a dict of the form described above.

    outfile : str or None
        If this is a str, will write the periodogram plot to the file specified
        by this string. If this is None, will write to a file called
        'lsp-plot.png' in the current working directory.

    plotdpi : int
        Sets the resolution in DPI of the output periodogram plot PNG file.

    Returns
    -------

    str
        Absolute path to the periodogram plot file created.