% Plot the results of deconv3_naive_comp.m
%
% Samuli Siltanen January 2015

% Parameters for controlling the plot
lwidth = 1;
fsize  = 20;
msize  = 6;

% Load precomputed stuff
load data/deconv1_cont Nt t psi Nx x convres a
load data/deconv3 n xvec f tvec p A recIC recICn mIC mICn mCF mCF rec mCFn recn

% Create a plot window
figure(1)
clf

% Plot target (both continuous and discrete)
subplot(4,1,1)
plot(x,target1(x),'k','linewidth',lwidth)
hold on
plot(xvec,target1(xvec),'k.','markersize',msize)
%plot(xvec,recIC,'r.','markersize',msize)
xlim([0 1])
title('Original target function','fontsize',fsize)

% Plot the datasets WITH INVERSE CRIME
subplot(4,1,2)
plot(x,convres,'r','linewidth',lwidth)
hold on
plot(xvec,mIC,'b.','markersize',msize)
plot(xvec,mICn,'m.','markersize',msize)
xlim([0 1])
title('Data WITH inverse crime','fontsize',fsize)

% Plot reconstruction
subplot(4,1,3)
plot(x,target1(x),'k','linewidth',lwidth)
hold on
plot(xvec,recIC,'b','linewidth',lwidth)
plot(xvec,recIC,'b.','markersize',msize)
xlim([0 1])
title('Naive reconstruction WITH inverse crime, no noise','fontsize',fsize)

% Plot reconstruction
subplot(4,1,4)
plot(x,target1(x),'k','linewidth',lwidth)
hold on
plot(xvec,recICn,'m','linewidth',lwidth)
plot(xvec,recICn,'m.','markersize',msize)
xlim([0 1])
title('Naive reconstruction WITH inverse crime, with noise','fontsize',fsize)



% Create a plot window
figure(2)
clf

% Plot target (both continuous and discrete)
subplot(4,1,1)
plot(x,target1(x),'k','linewidth',lwidth)
hold on
plot(xvec,target1(xvec),'k.','markersize',msize)
%plot(xvec,recIC,'r.','markersize',msize)
xlim([0 1])
title('Original target function','fontsize',fsize)

% Plot the datasets WITHOUT INVERSE CRIME
subplot(4,1,2)
plot(x,convres,'r','linewidth',lwidth)
hold on
plot(xvec,mCF,'b.','markersize',msize)
plot(xvec,mCFn,'m.','markersize',msize)
xlim([0 1])
title('Data WITHOUT inverse crime','fontsize',fsize)

% Plot reconstruction
subplot(4,1,3)
plot(x,target1(x),'k','linewidth',lwidth)
hold on
plot(xvec,rec,'b','linewidth',lwidth)
plot(xvec,rec,'b.','markersize',msize)
xlim([0 1])
title('Naive reconstruction WITHOUT inverse crime, no noise','fontsize',fsize)

% Plot reconstruction
subplot(4,1,4)
plot(x,target1(x),'k','linewidth',lwidth)
hold on
plot(xvec,recn,'m','linewidth',lwidth)
plot(xvec,recn,'m.','markersize',msize)
xlim([0 1])
title('Naive reconstruction WITHOUT inverse crime, with noise','fontsize',fsize)
