%% plotting

% h_e.sim=h_e.sim/sum(h_e.sim)/de;
% figure(1)
% clf;
% plot(e_plt,h_e.true, e_plt,h_e.sim)
% legend('true', 'sim')



xy_pmf=h_xy/sum(sum(h_xy))/dx^2;


%MULTISCALE METROPOLIS
figure(600) %===============================
clf;
%pmf along y
subplot(4,4,[1 5 9])
plot(-pmf.y,y3D, -y_pmf,y_plt,'r','LineWidth',2); grid on
axis tight;
%axis off;
%pmf along x
subplot(4,4,[14:16])
plot(x3D,pmf.x, x_plt,x_pmf,'r','LineWidth',2); grid on
axis tight;
%axis off;
subplot( 4,4,[ 2:4 6:8 10:12 ] )
%surface(x3D,y3D,exp(-V3D')); axis tight; xlabel X; ylabel Y;
%contourf(x3D,y3D,V3D');  %still not sure why I have to transpose V3D...

%imagesc(x3D,y3D(:),V3D'); axis xy 
imagesc(x3D,y3D(:),log(xy_pmf)); axis xy 

axis square
title('Multiscale Metropolis')
%colorbar;
hold on;

% figure(602)
% clf;
% contourf(x3D,y3D(:),f'); axis xy;
% axis square
% title('\rho_t');
% %colorbar

% figure(603)
% clf;
% title(fname)
% imagesc(x3D,y3D(:),xy_pmf); axis xy
% %colorbar
% axis square
% title('pmf');

% figure(604)
% 
% imagesc(x3D,y3D(:),xy_pmf-f'); axis xy 
% %colorbar
% axis square

%title('U_t-U_p_m_f  (>0 oversampled)');
title(fname)