%定义点的坐标 A01 = [-900, 1300]; A02 = [-600, 200]; A03 = [-400, 0]; A04 = [-100, 900]; A05 = [200, 500];

%定义两两连线 line1 = [A01; A02]; line2 = [A01; A03]; line3 = [A01; A04]; line4 = [A01; A05]; line5 = [A02; A03]; line6 = [A02; A04]; line7 = [A02; A05]; line8 = [A03; A04]; line9 = [A03; A05]; line10 = [A04; A05];

%画出连线 plot(line1(:,1), line1(:,2), 'b'); hold on; plot(line2(:,1), line2(:,2), 'b'); plot(line3(:,1), line3(:,2), 'b'); plot(line4(:,1), line4(:,2), 'b'); plot(line5(:,1), line5(:,2), 'g'); plot(line6(:,1), line6(:,2), 'g'); plot(line7(:,1), line7(:,2), 'g'); plot(line8(:,1), line8(:,2), 'r'); plot(line9(:,1), line9(:,2), 'r'); plot(line10(:,1), line10(:,2), 'r');

%定义垃圾箱坐标 box1 = [-887, 1253]; box2 = [-874, 1205]; box3 = [-861, 1157]; box4 = [-848, 1109]; box5 = [-835, 1061]; box6 = [-822, 1014]; box7 = [-809, 966]; box8 = [-796, 918]; box9 = [-783, 870]; box10 = [-770, 822]; box11 = [-757, 774]; box12 = [-744, 727]; box13 = [-731, 679]; box14 = [-718, 631]; box15 = [-705, 583]; box16 = [-692, 535]; box17 = [-679, 487]; box18 = [-666, 440]; box19 = [-653, 392]; box20 = [-640, 344]; box21 = [-627, 296]; box22 = [-614, 248];

%画出垃圾箱 scatter(box1(1), box1(2), 'm', 'filled'); hold on; scatter(box2(1), box2(2), 'm', 'filled'); scatter(box3(1), box3(2), 'm', 'filled'); scatter(box4(1), box4(2), 'm', 'filled'); scatter(box5(1), box5(2), 'm', 'filled'); scatter(box6(1), box6(2), 'm', 'filled'); scatter(box7(1), box7(2), 'm', 'filled'); scatter(box8(1), box8(2), 'm', 'filled'); scatter(box9(1), box9(2), 'm', 'filled'); scatter(box10(1), box10(2), 'm', 'filled'); scatter(box11(1), box11(2), 'm', 'filled'); scatter(box12(1), box12(2), 'm', 'filled'); scatter(box13(1), box13(2), 'm', 'filled'); scatter(box14(1), box14(2), 'm', 'filled'); scatter(box15(1), box15(2), 'm', 'filled'); scatter(box16(1), box16(2), 'm', 'filled'); scatter(box17(1), box17(2), 'm', 'filled'); scatter(box18(1), box18(2), 'm', 'filled'); scatter(box19(1), box19(2), 'm', 'filled'); scatter(box20(1), box20(2), 'm', 'filled'); scatter(box21(1), box21(2), 'm', 'filled'); scatter(box22(1), box22(2), 'm', 'filled');

Matlab可视化:绘制点连线和垃圾箱分布图

原文地址: https://www.cveoy.top/t/topic/ocbN 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录