sigpyproc.viz.styles#

Plotting styles for sigpyproc.

This module contains the Matplotlib/Seaborn style utilities for plotting in sigpyproc.

Classes

PlotTable

A class to plot text tables in matplotlib using relative positions.

TableEntry

Single entry in the PlotTable with optional unit.

Functions

set_seaborn

Set seaborn style with custom rc parameters.

class sigpyproc.viz.styles.PlotTable(col_offsets=None, top_margin=None, line_height=None, font_size=None, font_family=None)[source]#

Bases: object

A class to plot text tables in matplotlib using relative positions.

Parameters:
col_offsetsdict[str, float] | None, optional

Dictionary of column names to x-positions (0-1), by default None.

top_marginfloat | None, optional

Top margin as a fraction of the axis height, by default None.

line_heightfloat | None, optional

Height of each line as a fraction of the axis height, by default None.

font_sizeint | None, optional

Font size, by default None.

font_familystr | None, optional

Font family, by default monospace.

Methods

add_entry(name, value[, unit, color])

Add an entry to the table.

plot(ax)

Plot the table on the given axis.

skip_line()

Add a blank line to the table.

DEFAULTS = {'col_offsets': {'name': 0.4, 'unit': 0.85, 'value': 0.8}, 'font_family': 'monospace', 'font_size': 12, 'line_height': 0.05, 'top_margin': 0.05}#
add_entry(name, value, unit='', color='black')[source]#

Add an entry to the table.

skip_line()[source]#

Add a blank line to the table.

plot(ax)[source]#

Plot the table on the given axis.

class sigpyproc.viz.styles.TableEntry(name, value, unit=attr_dict['unit'].default, color=attr_dict['color'].default)[source]#

Bases: object

Single entry in the PlotTable with optional unit.

Attributes:
color
name
unit
value
name#
value#
unit#
color#
sigpyproc.viz.styles.set_seaborn(font_scale=1, font_size=14, palette='colorblind', *, use_latex=False, **rc_kwargs)[source]#

Set seaborn style with custom rc parameters.

Parameters:
font_scalefloat, optional

Seaborn theme font scale, by default 1.

font_sizeint | str, optional

Matplotlib font size, by default 14.

palettestr, optional

Seaborn palette name, by default “colorblind”.

use_latexbool, optional

Use LaTeX for text rendering, by default False