Apply the Haiqu matplotlib style
haiqu.sdk.set_haiqu_mpl_style(font_path=None)
Apply the Haiqu matplotlib style to the current session. Whenhaiqu.sdk is imported inside a Jupyter environment this function
is called automatically. Outside of Jupyter — for example in a script or a
testing harness — call it explicitly after importing haiqu.sdk.
The function makes the following changes to the active matplotlib session:
- Colour cycle — sets the default series colours to the Haiqu brand palette (Morpho Blue, Orange, Red, Light Blue, Black, Neutral Grey).
-
Colormaps — registers two named colormaps:
haiqu_blue— sequential, white → Light Blue → Morpho Blue.haiqu— diverging, Orange → white → Morpho Blue.
haiquis set as the default image colormap (image.cmap). - Typography — if available, registers and activates provided font as the monospace typeface used for tick labels, axis labels, and captions. Typically this should be the Suisse Int’l Mono font, if it is available. The font HAIQU_MPL_FONT_PATH environment variable or the font_path arg should provide the path.
-
Style — applies the bundled
haiqu.mplstylesheet (minimal axes, no top/right spines, dashed grid, square scatter markers, high-DPI save).
- Parameters:
font_path (str | None) — The path to the font. Defaults to
None. Iffont_pathis not specified, theHAIQU_MPL_FONT_PATHenvironment variable is checked. If it is not set, the matplotlib default font is used. - Return type: None
Examples
Automatic application inside a notebook (nothing extra required):Restore the default matplotlib style
haiqu.sdk.unset_haiqu_mpl_style()
Restore matplotlib to its default style, undoingset_haiqu_mpl_style().
Resets all rcParams to the matplotlib defaults (equivalent to calling
matplotlib.rcdefaults()). The two brand colormaps (haiqu_blue and
haiqu) remain available in the colormap registry and can still be
referenced by name, but they are no longer the active defaults.
Use this function when you need to produce a plot without the Haiqu style
in the same session where haiqu.sdk was imported.
Examples
Temporarily disable the Haiqu style for a single plot:- Return type: None