In the call to legend, you can specify which lines (or whatever) you want included.
Here it's legend_lines:
legend_lines = gobjects(1,c);
for i=1:c
if STR_type(i)==1 %%se sono aggregate
SumCTR_color(b(i),:)= col(i,:); %%cosi nel draw del SumCTR_strum gli do il colore uguale
end
%%********* FIRST PLOT ***********************
legend_lines(i) = plot(Ax_Eq,XDates,TE_strum(:,i)','DisplayName',STR_name{i},'Color',col(i,:),'LineWidth',width_arr(i));
%%**********************************************
text(Ax_Eq,r-2,TE_strum(end,i),strcat({' '},num2str(i)),'Color',col(i,:),'Interpreter','none');
if app.OOScolorCheckBox.Value %%mi colora di nero da dove inizia solo l'OOS (se ci sono 4 sistemi prende l'OOS piu' recente!!)!
oos=datetime(string({app.Sis.OOS}),'Format','dd/MM/yyyy');
xx=cell2mat(app.Seraf_T(:,3));
[~,xx_]=find(max(oos(xx))==XDates); %%max perche prendo l'OOS piu' recente!
%%********* SECOND PLOT ***********************
plot(Ax_Eq,XDates(xx_:end),TE_strum(xx_:end,i)','Color',"black",'LineWidth',width_arr(i));
%%***************************************
end
%%******************************
end
%%*************************
nm=Convert_ArrayDouble_StringDollar_Struct(TE_strum(end,:)',0);
tm=compose("%s", Ntrad_strum');
leg=strcat(string(1:c)',{' - '},string(STR_name),"==>",nm," ",tm);
legend(Ax_Eq,legend_lines,leg,'Location','northwest','Interpreter','none','Box','off');