visbrain.io.write_fig_hyp

visbrain.io.write_fig_hyp(data, sf, file=None, start_s=0, grid=False, ascolor=False, dpi=300, hstates=None, hvalues=None, hcolors=None, hYranks=None)[source][source]

Export hypnogram to a high-res png figure.

Parameters:
dataarray_like

Hypnogram vector

sffloat

The sampling frequency of displayed elements (could be the down-sampling frequency)

filestring | None

Output filename (with full path). If None, the plot is displayed.

start_sfloat | 0.

Record starting time given in seconds.

gridbool | False

Plot X and Y grid.

ascolorbool | False

Plot in color

dpiint | 600

Dots per inches

hstates: list[str]

List of vigilance state labels.

hvalues: list[int]

Hypnogram value for each vigilance state.

hcolors: list[int]

Hypnogram color for each vigilance state. Default is [‘#8bbf56’, ‘#56bf8b’, ‘#aabcce’, ‘#405c79’, ‘#0b1c2c’, ‘#bf5656’]

hYranks: list

List of Y position ranks on hypnogram for each state.

Examples using visbrain.io.write_fig_hyp

Matplotlib plot of an hypnogram

Matplotlib plot of an hypnogram