Heatmap on 1d-time series data
14 views (last 30 days)
i got several events on a 1-dimensional double Vector (about 60.000 x 1) (like a logical vector).
VecEvents=[0 0 0 1 0 1 0 1 1 0 1 0 0]; % 60.000x1 double
I extracted the timepoints the events occured and plotted them on a horizontal line to mark events:
Here is an example of my real data:
What I want is something like a coloured line or bar which highlights density of events.
My first approach was to smooth the vector linearly by a moving mean:
So, this is not a solution, but if I plot my averaged vector against the time it will look like this:
t=1:length(SmoothedEvents); % I used a different vector for x-axis in the plot underneath
Does anyone have a suggestion how to create a 1-dimensional heatmap (or something similar - see above) from my data? Is there even a better approach than averaging the vector?
KSSV on 8 Feb 2020
YOu can use somehting linke this:
x = 0:.05:2*pi;
y = sin(x);
z = zeros(size(x));
col = x; % This is the color, vary with x in this case.