Figure¶
-
class
texfigure.Figure(file_name, reference=None)[source]¶ Bases:
objectA class for holding a figure file, that knows how to represent itself as a latex environment.
Parameters: file_name :
strThe full path of the figure file.
reference :
strA reference label for this figure, used as default values for caption and label.
Examples
\begin{pycode} import matplotlib.pyplot as plt fig = plt.figure() plt.plot([1,2], [3,4], 'o') myfig = texfigure.Figure(fig, 'myfig') \end{pycode} \py|myfig|
Attributes
fname ( str) The base name of the full file pathbase_dir ( str) The directory containing the figure filecaption ( str) The caption to use when representing the figure. (DefaultFigure reference)label ( str) The latex label assigned to the figure envrionment, will bre prefixed with'fig. (Defaultfig:reference)placement ( str) The figure envrionment placement value. (Defaulth)figure_width ( str) The latex figure width, not used for pgf files. (Default0.95\columnwidth)subfig_width ( str) LaTeX figure width for when the figure is included in a subfigure. (Default0.45\columnwidth)subfig_placement ( str) The subfigure environment placement. (Defaultb)extension_mapping ( dict) A mapping of file extensions to methods to return LaTeX includes for the file type.fig_str ( str) The LaTeX template for representing thisFigureas a figure environment.subfig_str ( str) The LaTeX template for representing thisFigureas a subfigure.Attributes Summary
extensionFile extension of fname. fig_strsubfig_strMethods Summary
Attributes Documentation
-
extension¶ File extension of fname.
-
fig_str= '\n\\begin{{figure}}[{placement}]\n \\centering\n {myfig}\n \\caption{{{caption}}}\n \\label{{{label}}}\n\\end{{figure}}\n'¶
-
subfig_str= '\n \\begin{{subfigure}}[{placement}]{{{width}}}\n {myfig}\n \\caption{{{caption}}}\n \\label{{{label}}}\n \\end{{subfigure}}'¶
Methods Documentation
-