clf; subplot(231) plot(3,3,'r+','MarkerSize',12); grid on; axis([0 9 0 9]); set(gca,'ytick',[0 1 2 3 4 5 6 7 8 9]); set(gca,'xtick',[0 1 2 3 4 5 6 7 8 9]); title('instance #1'); subplot(232) plot(3,3,'r+',5,5,'r+','MarkerSize',12); % You can plot a rectangle with the command rectangle % see help rectangle hold on; r=rectangle('Position',[2 2 4 5],'LineWidth',3,'EdgeColor','g'); grid on; title('instance #2'); axis([0 9 0 9]); set(gca,'ytick',[0 1 2 3 4 5 6 7 8 9]); set(gca,'xtick',[0 1 2 3 4 5 6 7 8 9]); subplot(233) h=plot(3,3,'r+',5,5,'r+',1,2,'bo','MarkerSize',12); title('instance #3'); grid on; axis([0 9 0 9]); set(gca,'ytick',[0 1 2 3 4 5 6 7 8 9]); set(gca,'xtick',[0 1 2 3 4 5 6 7 8 9]); subplot(234) plot(3,3,'r+',5,5,'r+',1,2,'bo',4,8,'bo','MarkerSize',12); title('instance #4'); grid on; axis([0 9 0 9]); set(gca,'ytick',[0 1 2 3 4 5 6 7 8 9]); set(gca,'xtick',[0 1 2 3 4 5 6 7 8 9]); subplot(235) plot(3,3,'r+',5,5,'r+',1,2,'bo',4,8,'bo',7,2,'r+','MarkerSize',12); title('instance #5'); grid on; axis([0 9 0 9]); set(gca,'ytick',[0 1 2 3 4 5 6 7 8 9]); set(gca,'xtick',[0 1 2 3 4 5 6 7 8 9]); subplot(236) plot(3,3,'r+',5,5,'r+',1,2,'bo',4,8,'bo',7,2,'r+',8,5,'bo','MarkerSize',12); title('instance #6'); grid on; axis([0 9 0 9]); set(gca,'ytick',[0 1 2 3 4 5 6 7 8 9]); set(gca,'xtick',[0 1 2 3 4 5 6 7 8 9]);