def plot(self, filename=None, norm=False, ylim=None,<EOL>sides=None,  **kargs):
import pylab<EOL>from pylab import ylim as plt_ylim<EOL>_ = self.psd<EOL>if sides is not None:<EOL><INDENT>if sides not in self._sides_choices:<EOL><INDENT>raise errors.SpectrumChoiceError(sides, self._sides_choices)<EOL><DEDENT><DEDENT>if sides is None or sides == self.sides:<EOL><INDENT>frequencies = self.frequencies()<EOL>psd = self.psd<EOL>sides = self.sides<EOL><DEDENT>elif sides is not None:<EOL><INDENT>if self.datatype == '<STR_LIT>':<EOL><INDENT>if sides == '<STR_LIT>':<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT>logging.debug("<STR_LIT>")<EOL>frequencies = self.frequencies(sides=sides)<EOL>psd = self.get_converted_psd(sides)<EOL><DEDENT>if len(psd) != len(frequencies):<EOL><INDENT>raise ValueError("<STR_LIT>" % (len(psd), len(frequencies)))<EOL><DEDENT>if '<STR_LIT>' in list(kargs.keys()):<EOL><INDENT>save_ax = pylab.gca()<EOL>pylab.sca(kargs['<STR_LIT>'])<EOL>rollback = True<EOL>del kargs['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>rollback = False<EOL><DEDENT>if norm:<EOL><INDENT>pylab.plot(frequencies, <NUM_LIT:10> * stools.log10(psd/max(psd)),  **kargs)<EOL><DEDENT>else:<EOL><INDENT>pylab.plot(frequencies, <NUM_LIT:10> * stools.log10(psd),**kargs)<EOL><DEDENT>pylab.xlabel('<STR_LIT>')<EOL>pylab.ylabel('<STR_LIT>')<EOL>pylab.grid(True)<EOL>if ylim:<EOL><INDENT>plt_ylim(ylim)<EOL><DEDENT>if sides == '<STR_LIT>':<EOL><INDENT>pylab.xlim(<NUM_LIT:0>, self.sampling/<NUM_LIT>)<EOL><DEDENT>elif sides == '<STR_LIT>':<EOL><INDENT>pylab.xlim(<NUM_LIT:0>, self.sampling)<EOL><DEDENT>elif sides == '<STR_LIT>':<EOL><INDENT>pylab.xlim(-self.sampling/<NUM_LIT>, self.sampling/<NUM_LIT>)<EOL><DEDENT>if filename:<EOL><INDENT>pylab.savefig(filename)<EOL><DEDENT>if rollback:<EOL><INDENT>pylab.sca(save_ax)<EOL><DEDENT>del psd, frequencies<EOL>
a simple plotting routine to plot the PSD versus frequency.

        :param str filename: save the figure into a file
        :param norm: False by default. If True, the PSD is normalised.
        :param ylim: readjust the y range .
        :param sides: if not provided, :attr:`sides` is used. See :attr:`sides`
            for details.
        :param kargs: any optional argument accepted by :func:`pylab.plot`.

        .. plot::
            :width: 80%
            :include-source:

            from spectrum import *
            p = Periodogram(marple_data)
            p.plot(norm=True, marker='o')