MATLAB: Matlab 2018 – Figure legend swamped by data2, data3, data4,… used to be able to just put single legend entry.. how to revert to previous behavior

legendMATLAB

In updgrading to Matlab 2018 all my figure legends are broken. I use to use legend once for many lines from the same data. Current matlab legend help states "The legend automatically updates when you add or delete data series from the axes". This is true as now my legends are swamped even if I only call the legend after plotting a single line. How to have a limited number of legend labels, say 2, even when plotting 100's of lines on a figure.
A snippet of ugly code that used to work well for me, but now generates line 1 of a legend as I want and then data2, data3, … datan..
for i=1:length(ids)
plot(D{ids(i)},V{ids(i)},'k')
if i==1
hold on
legend('WSP','Location','Northwest')
end
end
hold off
Any help appreciated.

Best Answer

Do you mean:
legend('WSP', 'Location', 'Northwest', 'AutoUpdate', 'off')