% ========================================

% multiscale pmfs
x_pmf = h_x/sum(h_x)/dx;
y_pmf = h_y/sum(h_y)/dx;

figure(500)
clf;
subplot(2,1,1)

plot(x3D,pmf.x, x_plt,x_pmf,'r','LineWidth',2); grid on
%title('pmf(x)')
title(['run to i= ', num2str(i)])
subplot(2,1,2)
plot(y3D,pmf.y,y_plt,y_pmf,'r','LineWidth',2); grid on
title('pmf(y)')