scaffold.plotting ================= .. py:module:: scaffold.plotting Attributes ---------- .. autoapisummary:: scaffold.plotting.ADMIRAL scaffold.plotting.ASSETS_DIR scaffold.plotting.BLACK scaffold.plotting.BLUEBERRY scaffold.plotting.CARIBBEAN scaffold.plotting.CORAL scaffold.plotting.ELECTRIC scaffold.plotting.LAVENDER scaffold.plotting.LOGO_MAP scaffold.plotting.MXM_THEME scaffold.plotting.OFFWHITE scaffold.plotting.PINE scaffold.plotting.TITLE_FONT scaffold.plotting.VANILLA scaffold.plotting.VERMILLION scaffold.plotting.WHITE Classes ------- .. autoapisummary:: scaffold.plotting.MXM_STYLE Functions --------- .. autoapisummary:: scaffold.plotting.add_logo scaffold.plotting.get_color_cycle scaffold.plotting.get_mpl_context scaffold.plotting.get_rc_params Module Contents --------------- .. py:class:: MXM_STYLE(*args, **kwds) Bases: :py:obj:`enum.Enum` Plotting style options. .. py:attribute:: DARK :value: 2 .. py:attribute:: LIGHT :value: 1 .. py:function:: add_logo(fig: matplotlib.pyplot.Figure, style: MXM_STYLE = MXM_STYLE.LIGHT, variant: int = 0, logo_path: str | pathlib.Path | None = None, position: str = 'upper right', size: float = 0.08, alpha: float = 0.8) -> None Add a small logo to the corner of a matplotlib figure. :param fig: The matplotlib figure to add the logo to. :param style: The style, used to pick an appropriate default logo. Defaults to MXM_STYLE.LIGHT. :param variant: The variant of the style. Used to select a contrasting logo. Defaults to 0. :param logo_path: Path or URI to a custom logo image. If None, uses the default logo for the style/variant. :param position: Corner placement. One of "lower right", "lower left", "upper right", "upper left". :param size: Size of the logo as a fraction of figure height. Defaults to 0.08. :param alpha: Opacity of the logo. Defaults to 0.8. .. py:function:: get_color_cycle(style: MXM_STYLE = MXM_STYLE.LIGHT) -> List[str] Get color cycle for the chosen style. :param style: The style used for plotting. Defaults to MXM_STYLE.LIGHT. :type style: MXM_STYLE, optional :returns: List of colors for the color cycle. :rtype: List[str] .. py:function:: get_mpl_context(style: MXM_STYLE = MXM_STYLE.LIGHT, variant: int = 0) -> contextlib.AbstractContextManager[None] Get Matplotlib context manager for the chosen style. :param style: The style used for plotting. Defaults to MXM_STYLE.LIGHT. :type style: MXM_STYLE, optional :param variant: The variant of the style to use. Defaults to 0. :type variant: int, optional :returns: Context manager for Matplotlib. :rtype: AbstractContextManager[None] .. py:function:: get_rc_params(style: MXM_STYLE = MXM_STYLE.LIGHT, variant: int = 0) -> dict Get rc (runtime configuration) parameters for the chosen style. Used for customizing the properties and default styles of Matplotlib. Some fonts are not available by default in Matplotlib, so you may need to install them, see :ref:`plotting`. :param style: The style used for plotting. Defaults to MXM_STYLE.LIGHT. :type style: MXM_STYLE, optional :param variant: The variant of the style to use. Defaults to 0. :type variant: int, optional :returns: Dictionary with rc parameters. :rtype: dict .. py:data:: ADMIRAL :value: '#1D0693' .. py:data:: ASSETS_DIR .. py:data:: BLACK :value: '#000000' .. py:data:: BLUEBERRY :value: '#381D59' .. py:data:: CARIBBEAN :value: '#11D8C1' .. py:data:: CORAL :value: '#FF5665' .. py:data:: ELECTRIC :value: '#9E36FF' .. py:data:: LAVENDER :value: '#ABABF9' .. py:data:: LOGO_MAP .. py:data:: MXM_THEME .. py:data:: OFFWHITE :value: '#FFFAF4' .. py:data:: PINE :value: '#007D85' .. py:data:: TITLE_FONT .. py:data:: VANILLA :value: '#FFFFAE' .. py:data:: VERMILLION :value: '#CE3D4A' .. py:data:: WHITE :value: '#FFFFFF'