postprocessing.matplotlib ========================= .. py:module:: postprocessing.matplotlib Submodules ---------- .. toctree:: :maxdepth: 1 /developer_docs/autodoc/postprocessing/matplotlib/utils/index Functions --------- .. autoapisummary:: postprocessing.matplotlib.get_available_styles postprocessing.matplotlib.get_style postprocessing.matplotlib.get_colors postprocessing.matplotlib.adjust_spines postprocessing.matplotlib.save_figs Package Contents ---------------- .. py:function:: get_available_styles() Function to get a list of the names of the available styles. :Returns: list List of names of available styles. .. !! processed by numpydoc !! .. py:function:: get_style(style_name='doumont-light') Function to get the stylesheet that can be passed to matplotlib's style setting functions. :Parameters: **style_name** : str Name of desired style. Default is "doumont-light". :Returns: str The style string that can be passed to the matplotlib style setting function. .. !! processed by numpydoc !! .. py:function:: get_colors(style_name=None, rcParams=False) Function to get colors associated with a matplotlib style, using either the current style or a specified style. This function does not work for built-in matplotlib styles. :Parameters: **style_name** : str Name of the desired style. Default is None, which returns the colors from the current style. **rcParams** : bool Flag to return the colors associated with rcParams. Default is False. :Returns: dict Dictionary of colors used in the style. .. !! processed by numpydoc !! .. py:function:: adjust_spines(ax=None, spines=['left', 'bottom'], outward=True) Function to shift the axes/spines. :Parameters: **ax** : Matplotlib axes Figure axes to adjust. Default is None, which will pickup the current axes. **spines** : list List of strings defining which spines to adjust. Default is left and bottom. **outward** : bool Flag to shift spines outward. Default is False. .. !! processed by numpydoc !! .. py:function:: save_figs(fig, name, formats, format_kwargs=None, **kwargs) Function to save figures in multiple file formats with user specied options. :Parameters: **fig** : Matplotlib figure The figure to save. **name** : str Output path for the figure files, e.g "path/to/file/file_name". No file extension required. **formats** : str or list File formats to save the figure in, e.g. "png", "pdf", "svg". **format_kwargs** : dict A dictionary of dictionaries, where the keys are the file formats and the values are any keyword arguments that should only be applied to that format. These kwargs will be added to ones passed to all formats, by default None **kwargs** Any keyword arguments to pass to `plt.savefig()` for all formats. .. !! processed by numpydoc !!