r"""Save the plot as a LaTeX file.

        The output file can be included (using \input) in your LaTeX document.
        It can also be compiled as a standalone document to generate a
        (cropped) pdf version of the plot.

        :param dest_path: path of the file.

def save(self, dest_path):
        r"""Save the plot as a LaTeX file.

        The output file can be included (using \input) in your LaTeX document.
        It can also be compiled as a standalone document to generate a
        (cropped) pdf version of the plot.

        :param dest_path: path of the file.

        """
        self.save_assets(dest_path)
        self.external_filename = 'externalized-%s' % \
                                 os.path.basename(dest_path).replace(' ', '_')
        dest_path = self._add_extension('tex', dest_path)
        with open(dest_path, 'w') as f:
            f.write(self.render())