可以使用legend函数来添加图例,示例代码如下:

% 生成随机数据
x = rand(1, 50);
y = rand(1, 50);
c = rand(1, 50);

% 绘制散点图
scatter(x, y, 50, c, 'filled');

% 添加图例
legend('data points');

其中,'data points'是图例的名称,可以根据实际需要进行修改。


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

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