StyleSpec
Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.
- class StyleSpec(name: str, single_column_mm: float = 89.0, double_column_mm: float = 183.0, dpi: int = 300, font_family: str = 'sans-serif', font_size: float = 8.0, line_width: float = 1.0, palette: ~typing.Tuple[str, ...] = ('#0072B2', '#D55E00', '#009E73', '#CC79A7', '#E69F00', '#56B4E9', '#F0E442', '#000000'), extra_rcparams: ~typing.Dict[str, object] = <factory>)[source]
Bases:
objectA named bundle of figure-geometry and typography choices.
- name
Preset identifier used with
use_style().- Type:
- single_column_mm
Width of a single-column (or minimum submission) figure in millimetres.
- Type:
- dpi
Default
savefig.dpihint for raster export. Callers may override atsavefigtime (e.g. RSNA line art at 1200 dpi).- Type:
- figsize(*, columns: int = 1, height_mm: float | None = None) Tuple[float, float][source]
Return an inch figure size for a one- or two-column figure.
- Parameters:
columns –
1for a single-column-width figure,2for full text width.height_mm – Optional explicit height in millimetres; defaults to a 4:3-ish proportion of the chosen width.
- Returns:
(width_in, height_in)suitable formatplotlib.
- __init__(name: str, single_column_mm: float = 89.0, double_column_mm: float = 183.0, dpi: int = 300, font_family: str = 'sans-serif', font_size: float = 8.0, line_width: float = 1.0, palette: ~typing.Tuple[str, ...] = ('#0072B2', '#D55E00', '#009E73', '#CC79A7', '#E69F00', '#56B4E9', '#F0E442', '#000000'), extra_rcparams: ~typing.Dict[str, object] = <factory>) None