matlab 叠加legend用法,matlab绘图中legend的终极用法

这篇博客介绍了MATLAB中legend的多种高级用法,包括指定显示位置、选择显示特定曲线的legend、实现横排布局以及隐藏边框等技巧。通过实例展示了如何有效地控制图形的legend,提升图表的可读性。
摘要由CSDN通过智能技术生成

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%持续更新。 当前: 20100108 %

%仅作笔记。 作者: keyflying %

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

legend有时候挺烦人的,尽管大多时候挺好用。

基本数据:

data = rand(25)+repmat(1:25,25,1);

H = plot(data);

基本用法:

legend({'str1','str2','strn'});

高级用法1:指定legend显示的位置:

legend({'str1','str2','strn'},1);

legend({'str1','str2','strn'},2);

legend({'str1','str2','strn'},'Location','SouthEast');

可选的位置很多:

North:Inside plot box near top

South:Inside bottom

EastI:nside right

West:Inside left

NorthEast:Inside top right (default)

NorthWest:Inside top l

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值