Utils Module
datachart.utils
The module containing the utils
.
The utils
module provides a set of utilities used in the package.
MODULE | DESCRIPTION |
---|---|
stats |
The module containing the statistics functions. |
FUNCTION | DESCRIPTION |
---|---|
save_figure |
Saves the figure into a file using the provided format parameters. |
Functions
datachart.utils.save_figure
save_figure(
figure: plt.Figure,
path: str,
dpi: int = 300,
format: FIG_FORMAT = None,
transparent: bool = False,
) -> None
Save the figure to a file.
Examples:
>>> # 2. save the figure
>>> from datachart.utils.figure import save_figure
>>> from datachart.constants import FIG_FORMAT
>>> path = "/path/to/save/chart.png"
>>> save_figure(figure, path, dpi=300, format=FIG_FORMAT.PNG, transparent=True)
PARAMETER | DESCRIPTION |
---|---|
figure
|
The figure to save.
TYPE:
|
path
|
The path where the figure is saved.
TYPE:
|
dpi
|
The DPI of the figure.
TYPE:
|
format
|
The format of the figure. If
TYPE:
|
transparent
|
Whether to make the background transparent.
TYPE:
|