Matlab 如何用legend标记部分曲线
%生成25*25矩阵
data = rand(25)+repmat(1:25,25,1);
H = plot(data);
%只对其中的部分曲线进行标注
h1=legend(H([1 6 11 16 21]),'1','6','11','16','21')
%使得标注横向显示
set(h1,'Orientation','horizon')
%去除标记框的外围长方形
set(h1,'Box','off');
%生成25*25矩阵
data = rand(25)+repmat(1:25,25,1);
H = plot(data);
%只对其中的部分曲线进行标注
h1=legend(H([1 6 11 16 21]),'1','6','11','16','21')
%使得标注横向显示
set(h1,'Orientation','horizon')
%去除标记框的外围长方形
set(h1,'Box','off');