Exemplo n.º 1
0
    def _write_or_log(self, figure_path, caption, width, create_from_function, create_kwargs, write_unique):

        if write_unique:
            head, tail = os.path.split(figure_path)
            texfile_path = os.path.join(head, ".".join(tail.split(".")[:-1] + ["tex"]))
            tw = TeXWriter(self.main_path, texfile_path)
            tw.add_figure(figure_path, caption, width, create_from_function, create_kwargs)
            tw.write()

        TeXWriter.add_figure(self, figure_path, caption, width, create_from_function, create_kwargs)
Exemplo n.º 2
0
    def add_quiver_plot(self, caption, width, write_unique=False):
        """
        Adds a quiver plot to the texdoc, has no special arguments.

        :param caption:         Tex caption to add to figure
        :param width:           the width of the plot on the page such as '5in'
        :param write_unique:    set True to write a tex file for this individual figure.
        """

        create_kwargs = {}  # no interesting kwargs at the moment
        create_from_function = self.axial_vortex.quiver_plot

        figure_filename = "{0}_quiver.jpg".format(self.tex_title)
        figure_path = os.path.join(self.figure_dir, figure_filename)
        TeXWriter.add_figure(self, figure_path, caption, width, create_from_function, create_kwargs)