source ("config/plot-setup.m");
readings = [10 11 11.5 12 12.2 12.6 13 15 15.5 16];
y = linspace (8, 18, 201).'; bandwidth = 0.6;
z = (y-readings)/bandwidth;
density = mean (exp(-0.5.*z.^2), 2)/(bandwidth*sqrt(2*pi));
width = 0.8 .* density;
figure (1); fill ([1-width; flipud(1+width)], [y; flipud(y)], ...
                 [.70 .83 .92], "edgecolor", [0 .35 .60]); hold on;
plot (ones(size(readings)), readings, "k.", "markersize", 8);
set (gca, "xtick", 1, "xticklabel", {"Site one"});
ylabel ("Reading (C)"); title ("Density width depends on a stated bandwidth");
xlim ([.5 1.5]); ylim ([8 18]);
printf ("Density area over shown range: %.6f\n", trapz(y,density));
print (gcf, "figures/OCT-16-006.pdf", "-dpdfcairo");
close all;
