yasa.EpochByEpochAgreement.plot_hypnograms#

EpochByEpochAgreement.plot_hypnograms(sleep_id=None, legend=True, ax=None, ref_kwargs={}, obs_kwargs={})[source]#

Plot the two hypnograms of one session overlapping on the same axis.

See also

yasa.plot_hypnogram

Parameters:
sleep_ida valid sleep ID or None

The sleep session to plot. If multiple sessions are included in the EpochByEpochAgreement instance, a sleep_id must be provided. If only one session is present, None (default) will plot the two hypnograms of the only session.

legendbool or dict

If True (default) or a dictionary, a legend is added. If a dictionary, all key/value pairs are passed as keyword arguments to the matplotlib.pyplot.legend call.

axmatplotlib.axes.Axes or None

Axis on which to draw the plot, optional.

ref_kwargsdict

Keyword arguments passed to yasa.plot_hypnogram when plotting the reference hypnogram.

obs_kwargsdict

Keyword arguments passed to yasa.plot_hypnogram when plotting the observed hypnogram.

Returns:
axmatplotlib.axes.Axes

Matplotlib Axes

Examples

>>> from yasa import simulate_hypnogram
>>> hyp = simulate_hypnogram(scorer="Anthony", seed=19)
>>> ax = hyp.evaluate(hyp.simulate_similar(scorer="Alan", seed=68)).plot_hypnograms()
../_images/yasa-EpochByEpochAgreement-plot_hypnograms-1.png