hypnoplot

hypnoplot(varargin)

HYPNOPLOT Make a pretty plot of a hypnogram

Usage:

hyp_handle = hypnoplot(times, stages, groupNREM) hyp_handle = hypnoplot(hypnostruct, groupNREM)

Input:

times: 1xN vector of stage times stages: 1xN vector of stage values (0:Undefined, 5: Wake, 4:REM, 3:N1, 2:N2, 1:N3) groupNREM: boolean - Use the same color for all NREM stages (default: true)

Output:

hyp_handle: handle to stairs object for hypnogram

Example:

%Load example data load(‘/data/preraugp/archive/Lunesta Study/sleep_stages/Lun01-Night1.mat’);

%Make reduced hypnogram t_inds=unique([1; find(diff(stage_struct.stage)~=0)+1; length(stage_struct.stage)]);

hyp_times=stage_struct.time(t_inds); hyp_stages=stage_struct.stage(t_inds);

figure; hypnoplot(hyp_times, hyp_stages);

Copyright 2021 Michael J. Prerau, Ph.D. - http://www.sleepEEG.org This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. (http://creativecommons.org/licenses/by-nc-sa/4.0/)

Last modified 11/12/2018