function CvxHull3Points
% show convex set out of three points
%
% M. Herceg 2014, ETH Zurich,
% requires MPT3


close all
%% printing parameters
label_font_size = 14;
tick_font_size = 10;
line_width = 0.8;
axeswidth=0.2;
% create new folder for storing figures
mkdir('figures');
figure_name = ['.',filesep,'figures',filesep,'fig_4_0'];
close all

%% core code
% vertices of a polytope
V = [1 1; 1 0 ; 0 1];
P = Polyhedron(V);
% plot the polytope
h = P.plot('Color',[0.9 0.9 0.9],'LineWidth',line_width);
grid on
hold on
plot(V(:, 1), V(:, 2), 'k.', 'markersize', 20);
plot(0.4, 0.8, 'k.', 'markersize', 20);
ht=text(0.45,0.82,'$\bar{x}$');
set(ht, 'FontSize', label_font_size);
axis([-0.5 2 -0.5 2]);

%% save book figures
% custom axis labels & font size
hx = xlabel('$x_1$');
set(hx, 'FontSize', label_font_size);
hy = ylabel('$x_2$');
set(hy, 'FontSize', label_font_size);
set(gca,'LineWidth',axeswidth)

% font size of tick labels
set(gca, 'FontSize', tick_font_size);

% generate FIG file
disp('Hit any key to print the figure and continue.');
pause
saveas(gcf, [figure_name '_matlab'], 'fig');

% print using laprint
title('')
laprint(gcf, [figure_name '_tex'],'scalefonts','off');

fprintf('Figure "%s" generated...\n', figure_name);

end