legend 関数は、R2017a より Axes のアップデートに対応するよう、仕様変更されています。
例えば、Axes 上に plot でラインが表示されると、自動的に凡例にもそのラインが追加されます。
この自動アップデートを行いたくない場合には、以下のように、legend 関数において、'AutoUpdate' プロパティを 'off' に設定します。
legend('Line1','AutoUpdate','off');
Figure 全体に対して、凡例の自動アップデートを無効にしたい場合には、Figure の 'defaultLegendAutoUpdate' プロパティを 'off' に設定します。
figure(1);
set(gcf,'defaultLegendAutoUpdate','off')
また、個々のオブジェクトについて、凡例の表示・非表示を設定したい場合には、オブジェクト下の Annotation のプロパティで制御可能です。
p = plot(1:10,'DisplayName','Line Chart');
hold on
s = stem(1:10,'DisplayName','Stem Chart');
hold off
s.Annotation.LegendInformation.IconDisplayStyle = 'off'; % step プロットの凡例の非表示設定
legend('show') % 凡例の表示

関連する内容が以下の URL からご覧いただけます。
・R2017a Release Notes
・Line オブジェクト:Annotation プロパティ