postprocessing.plotly.utils
Functions
Function to get a list of the names of the available styles. |
|
|
Function to get the stylesheet that can be passed to plotly's style |
|
Function to get colors associated with a Plotly template. |
|
Function to save Plotly figures in multiple file formats with user-specified |
Module Contents
- postprocessing.plotly.utils.get_available_styles()
Function to get a list of the names of the available styles.
- Returns:
- list
List of names of available styles.
- postprocessing.plotly.utils.get_style(style_name='doumont-light')
Function to get the stylesheet that can be passed to plotly’s style setting functions.
- Parameters:
- style_namestr
Name of desired style. Default is “doumont-light”.
- Returns:
- tuple of string and dict
The style string and dictionary (as a tuple) that can be passed to the plotly template setting function.
- postprocessing.plotly.utils.get_colors(style_name=None, rcParams=False)
Function to get colors associated with a Plotly template.
- Parameters:
- style_namestr
Name of the desired Plotly template. Default is None, which returns the colors from the current template.
- rcParamsbool
Flag to return additional color settings (axis, background, text). Default is False.
- Returns:
- dict
Dictionary of colors used in the template.
- postprocessing.plotly.utils.save_figs(fig, name, formats, format_kwargs=None, **kwargs)
Function to save Plotly figures in multiple file formats with user-specified options.
- Parameters:
- figPlotly figure
The figure to save.
- namestr
Output path for the figure files, e.g “path/to/file/file_name”. No file extension required.
- formatsstr or list
File formats to save the figure in, e.g. “png”, “pdf”, “svg”, “html”.
- format_kwargsdict
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 the saving function for all formats.