function [H, Y] = hist_cluster(D)

x_range = size(D,1);
n_curves = size(D,2);
n_bins = n_curves/5;

H = zeros(x_range,n_bins);
Y = zeros(x_range,n_bins);
for i=1:x_range
    [H(i,:), Y(i,:)] = hist(D(i,:),n_bins);
end

X = repmat([1:x_range]',1,n_curves);
pcolor(X,Y,H);


end