%% Create points plot
figure
plot([1,1,5],[0,2,2],'linewidth',2)
axis equal
xlim([0,2])
ylim([0,4])
xlabel('x1')
set(gcf,'Color',[1,1,1])
ylabel('x2')
hold on
% Create point groups
xp = rand(20,1)*2;
yp = rand(20,1)*4;
idx = xp>1 & yp<2;
scatter(xp(idx),yp(idx),[],'g')
scatter(xp(~idx),yp(~idx),[],'r')
%% Create patch plot
figure
patch([0,0,2,2,1.5,1.5,1,1,0],[0,4,4,2,2,3,3,0,0],'y')
patch([1,1,1.5,1.5,2,2,1],[0,3,3,2,2,0,0],'r')
xlabel('x1');ylabel('x2');
xlim([0,2]);ylim([0,4]);
set(gcf,'Color',[1,1,1])
text(0.5,3,'2','FontSize',20,'FontWeight','Bold')
text(1.5,1,'1','FontSize',20,'FontWeight','Bold')