pyexlatex.figure.models package¶
Submodules¶
pyexlatex.figure.models.figure module¶
- class pyexlatex.figure.models.figure.Figure(subfigures, caption=None, label=None, centering=True, position_str=None, landscape=False, short_caption=None)[source]¶
Bases:
pyexlatex.models.containeritem.ContainerItem
,pyexlatex.models.item.Item
Used for creating latex figures from images. Currently the main usage is the Figure class created with the method Figure.from_dict_of_names_and_filepaths. Pass a dictionary where the keys are names for subfigures and the values are filepaths where the image for the subfigure is located.
- __init__(subfigures, caption=None, label=None, centering=True, position_str=None, landscape=False, short_caption=None)[source]¶
- classmethod from_dict_of_names_and_filepaths(filepath_name_dict, figure_name=None, position_str_name_dict=None, **kwargs)[source]¶
Create a Figure from a dictionary where keys are names of subfigures and values are file paths
- Parameters
filepath_name_dict¶ (
dict
) – dictionary where keys are names of subfigures and values are the filepaths to the images for those subfigures.position_str_name_dict¶ (
Optional
[dict
]) – dictionary where keys are names of subfigures and values are the position strs for those figures, e.g. r’[t]{0.45linewidth}’kwargs¶ – kwargs for Figure
- Returns
Figure
- classmethod from_dict_of_names_and_plt_figures(plt_fig_name_dict, sources_outfolder, source_filetype='pdf', figure_name=None, position_str_name_dict=None, **kwargs)[source]¶
Create a Figure from a dictionary where keys are names of subfigures and values are matplotlib Figures or Axes
- Parameters
plt_fig_name_dict¶ (
Dict
[str
,Union
[ForwardRef
,ForwardRef
]]) – Key is display name in output figure, value is matplotlib axes or figuresources_outfolder¶ (
str
) – folder to output individual matplotlib figuressource_filetype¶ (
str
) – Filetype for individual plt figures. The default is pdf. Use png or another image type if outputting complicated figures or performance may be affected when viewing the pdf.position_str_name_dict¶ (
dict
) – dictionary where keys are names of subfigures and values are the position strs for those figures, e.g. r’[t]{0.45linewidth}’kwargs¶ – kwargs for Figure
- Returns
Figure
- name = 'figure'¶
pyexlatex.figure.models.graphic module¶
- class pyexlatex.figure.models.graphic.Graphic(filepath, width=1.0, cache=True, options=None, overlay=None)[source]¶
Bases:
pyexlatex.models.item.SimpleItem
Basic class for including graphics, just the image with no structure.
In most documents, a Figure would be used to give more structure to the graphic. This class will literally just include the image with no other structure. It is typically more useful in presentations where the structure is already being provided.
- name = 'includegraphics'¶
pyexlatex.figure.models.inlinegraphic module¶
- class pyexlatex.figure.models.inlinegraphic.InlineGraphic(filepath, width=1.0, cache=True, options=None, overlay=None)[source]¶
Bases:
pyexlatex.models.item.MultiOptionSimpleItem
,pyexlatex.figure.models.graphic.Graphic
A version of Graphic that is meant to be used within text. It centers the text vertically when the graphic is taller than the text.
- name = 'vcenteredinclude'¶
pyexlatex.figure.models.subfigure module¶
- class pyexlatex.figure.models.subfigure.Subfigure(filepath, caption=None, label=None, centering=True, position_str='[t]{0.45\\\\linewidth}', cache=True)[source]¶
Bases:
pyexlatex.models.containeritem.ContainerItem
,pyexlatex.models.item.Item
Used for more control over building figures
- __init__(filepath, caption=None, label=None, centering=True, position_str='[t]{0.45\\\\linewidth}', cache=True)[source]¶
- name = 'subfigure'¶