source ("config/plot-setup.m");
readings = [10 11 11 12 12 12 13 14 15 17]; edges = [10 12 15 18];
count = histc (readings, edges); widths = diff (edges);
assert (count(end)==0);
density = count(1:end-1) ./ (numel(readings).*widths);
figure (1); hold on;
for k = 1:numel(widths)
  fill ([edges(k) edges(k+1) edges(k+1) edges(k)], ...
        [0 0 density(k) density(k)], [0 .35 .60], "edgecolor", [1 1 1]);
endfor
xlabel ("Reading (C)"); ylabel ("Probability density (1/C)");
title ("Probability is rectangle area"); xlim ([9 19]); ylim ([0 .22]);
printf ("Total histogram area: %.6f\n", sum(density.*widths));
print (gcf, "figures/OCT-16-002.pdf", "-dpdfcairo");
close all;
