You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.2 KiB
38 lines
1.2 KiB
%--------------------------
|
|
% @Author: Jingqiao Hu
|
|
% @Date: 2022-05-08 20:23:49
|
|
% @LastEditTime: 2022-05-08 20:23:49
|
|
%--------------------------
|
|
function plot_MMC(MMCs_poly, maxx, minx, maxy, miny,optDesign,seeds,loop)
|
|
% test polyshape
|
|
figure(1); clf;
|
|
for i = 1:size(MMCs_poly,1)
|
|
n = reshape(MMCs_poly(i,:), 2, 4)';
|
|
p = polyshape(n);
|
|
plot(p,'FaceColor','k','FaceAlpha',1,'EdgeColor','none'); hold on;
|
|
% plot(p,'FaceColor',[0.8,0.8,0.8],'FaceAlpha',1,'EdgeColor',[0.8,0.8,0.8]); hold on;
|
|
end
|
|
axis equal;
|
|
axes1 = gca;
|
|
set(axes1,'Xlim',[minx, maxx],'Ylim',[miny, maxy]);
|
|
axis off;
|
|
|
|
if strcmp(optDesign, 'Lshape')
|
|
bbx_x = [minx,maxx,maxx,0,0, minx,minx]';
|
|
bbx_y = [miny,miny,0, 0,maxy,maxy,miny]';
|
|
else
|
|
bbx_x = [minx,maxx,maxx,minx,minx]';
|
|
bbx_y = [miny,miny,maxy,maxy,miny]';
|
|
end
|
|
% hold on; plot(bbx_x,bbx_y,'k','LineWidth',1);
|
|
axis equal;
|
|
axis off; pause(1e-6);
|
|
colormap(gray); caxis([-2,1]);
|
|
|
|
hold on; scatter(seeds(:,1), seeds(:,2),8,'filled','k');
|
|
|
|
|
|
|
|
datapath = "data/fig/vor_"+optDesign+"_"+loop+".png";
|
|
saveas(gcf, datapath);
|
|
end
|