% Plot the results of routine DC2_discretedata_comp.m.
%
% Samuli Siltanen January 2011

% Plot parameters
fsize  = 10;
lwidth = .5;
msize = 5;

% Load precomputed results
load data/DC_cont_data x Af a Ca psf xp
xx = x;
load data/DC_discr_data A x m mn PSF noiselevel

% Create plot window
figure(1)
clf
subplot(1,2,1)

% Plot the convolved function (continuum version)
plot(xx,Af,'k','linewidth',lwidth)
hold on

% Plot the discrete data
plot(x,m,'b.','markersize',msize)

% Axis settings
axis([0 1 -.2 1.3])
box off
set(gca,'ytick',[0,.5,1],'fontsize',fsize)
%set(gca,'yticklabel',{},'fontsize',fsize)
set(gca,'xtick',[0,.5,1],'fontsize',fsize)
set(gca,'PlotBoxAspectRatio' , [2 1 1])
title('Non-noisy data')

% Create subplot 
subplot(1,2,2)

% Plot the convolved function (continuum version)
plot(xx,Af,'k','linewidth',lwidth)
hold on

% Plot the noisy data
plot(x,mn,'b.','markersize',msize)

% Axis settings
axis([0 1 -.2 1.3])
box off
set(gca,'ytick',[0,.5,1],'fontsize',fsize)
set(gca,'yticklabel',{},'fontsize',fsize)
set(gca,'xtick',[0,.5,1],'fontsize',fsize)
set(gca,'PlotBoxAspectRatio' , [2 1 1])
title(['Data with ', num2str(round(100*noiselevel)), '% noise'])

% Create plot window
figure(2)
clf

% Show nonzero entries of matrix A
spy(A)
title('Nonzero elements of matrix A')