Matlab 绘制线段、点和垃圾桶位置图
x = [-100 500]; % 线的 x 坐标 y = [400 400]; % 线的 y 坐标 plot(x, y, 'linewidth', 2); % 画出线
hold on; % 保持图像
scatter(-100, 400, 'filled'); % 画出垃圾箱 1 scatter(200, 400, 'filled'); % 画出垃圾箱 2 scatter(-600, 200, 'filled'); % 画出 A02 scatter(200, 500, 'filled'); % 画出 A05
scatter(-100, 400, 'filled'); % 画出线左端的垃圾桶 scatter(500, 400, 'filled'); % 画出线右端的垃圾桶
axis([-700 600 0 600]); % 设置坐标轴范围 set(gca,'DataAspectRatio',[1 1 1]); % 设置坐标轴比例为 1:1:1 xlabel('X'); % 设置 x 轴标签 ylabel('Y'); % 设置 y 轴标签 title('垃圾桶和线的位置'); % 设置标题
hold off; % 释放图像
原文地址: https://www.cveoy.top/t/topic/ocki 著作权归作者所有。请勿转载和采集!