function sample_plots_for_inerpolation()
x=[0,  3  ,1,  5,  6, 10,  8];
y=[0,  3, .5,  8,  6,  2,  3];


fh1=figure(1);
%hold off;

function nice_blue_data_points_plot(fh,x2plot,y2plot)
	axes('Parent', gcf, 'FontSize',24,'FontName','DejaVu Sans');

	plot(x2plot,y2plot,'o', ...
		'MarkerFaceColor',[0.8 0.88 0.97],...
		'MarkerEdgeColor',[0 0 1],...
		'MarkerSize',8,...
		'Marker','o',...
		'LineWidth',2,...
		'LineStyle','none');


	% Create title
	title('Data','FontSize',24,'FontName','DejaVu Sans');

	% Create xlabel
	xlabel('x','FontSize',24,'FontName','DejaVu Sans');

	% Create ylabel
	ylabel('y','FontSize',24,'FontName','DejaVu Sans');
end

function nice_red_data_points_plot(fh,x2plot,y2plot)
	axes('Parent', fh, 'FontSize',24,'FontName','DejaVu Sans');

	plot(x2plot,y2plot,'o', ...
		'MarkerFaceColor',[0.99 0.88 0.88],...
		'MarkerEdgeColor',[1 0 0],...
		'MarkerSize',8,...
		'Marker','o',...
		'LineWidth',2,...
		'LineStyle','none');


	% Create title
	title('Data','FontSize',24,'FontName','DejaVu Sans');

	% Create xlabel
	xlabel('x','FontSize',24,'FontName','DejaVu Sans');

	% Create ylabel
	ylabel('y','FontSize',24,'FontName','DejaVu Sans');
end


nice_blue_data_points_plot(fh1,x,y);
print('data_sample.eps', '-depsc')

Np=300;
xi=linspace(0,10,Np);



fh2=figure(2);
%hold off;
yi=interp1(x,y,xi,'nearest');
nice_blue_data_points_plot(fh2,x,y);
hold on;
plot(xi, yi, '-');
print('nearest_neighbor_interpolation.eps', '-depsc')

fh3=figure(3);
%hold off;
yi=interp1(x,y,xi,'linear');
nice_blue_data_points_plot(fh3,x,y);
hold on;
plot(xi, yi, '-');
print('linear_interpolation.eps', '-depsc')

fh4=figure(4);
%hold off;
yi=interp1(x,y,xi,'spline');
nice_blue_data_points_plot(fh4,x,y);
hold on;
plot(xi, yi, '-');
print('spline_interpolation.eps', '-depsc')

fh5=figure(5);
%hold off;
p=polyfit(x, y, (length(x)-1) );
yi=polyval(p,xi);
nice_blue_data_points_plot(fh5,x,y);
hold on;
plot(xi, yi, '-');
print('polyfit_interpolation.eps', '-depsc')


end

