I want to ignore markers in my legend but do not know how to do this properly. k in this code is the variable in the for loop that is being incremented.
C = {'k','b','r','g','y',[.5 .6 .7],[.8 .2 .6]}; Plot1 = loglog(Discret,L2err,'.r', 'MarkerSize',15);hold onPlot2 = loglog(Discret,L2err,'color',C{k}, 'LineWidth', 2);legendInfo{k} = ['Factor = ' num2str(k)];legend(Plot2,legendInfo)legend(legendInfo)triang_x = [Discret(2), Discret(5)];triang_y = interp1(Discret, L2err, triang_x);hold onz = loglog(triang_x([1,2,2]), triang_y([1,1,2]), 'k', 'LineWidth', 2);grid on
Problem is also that the lines of the triangle also goes into the legend. Any ideas on how to fix this? Really appreciate it!
Best Answer