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
EpochByEpochAgreementinstance, asleep_idmust 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.legendcall.- ax
matplotlib.axes.Axesor None Axis on which to draw the plot, optional.
- ref_kwargsdict
Keyword arguments passed to
yasa.plot_hypnogramwhen plotting the reference hypnogram.- obs_kwargsdict
Keyword arguments passed to
yasa.plot_hypnogramwhen plotting the observed hypnogram.
- Returns:
- ax
matplotlib.axes.Axes Matplotlib Axes
- ax
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()