close all; % matlab file for plotting optimal polygon of radius 1 load ngon_coords.dat; % transfer to X and Y matrices X = ngon_coords(:,1); Y = ngon_coords(:,2); % plot it in a nice color, using ColorSpec's RGB array % fill(X,Y,[1 0 1]); % use a random color instead; fill(X,Y,[.5 .5 .5] + .5*rand(1,3)); hold on; scatter(X,Y,'r','*'); % give it a title (specify number of vertices) title(['Optimal Polygon with ',num2str(size(X,1)),' Vertices and Radius 1']); % figure the range, making sure the area is square to prevent distortion xmin = min(X); xmax = max(X); xmid = (xmax+xmin)/2; xdiff = xmax-xmin; ymin = min(Y); ymax = max(Y); ymid = (ymax+ymin)/2; ydiff = ymax-ymin; diff = 1.2 * max([xdiff ydiff]); xmin = xmid - diff/2; xmax = xmid + diff/2; ymin = ymid - diff/2; ymax = ymid + diff/2; axis([xmin xmax ymin ymax]); % need this to ensure that the area plotted is indeed square axis square;