Dear all, I would like to insert legend inside the for loop plot. In this plot same class repeated many times. I want to display one categorry at a time.
for i = 1:udClass Legend{i} = ['Class' int2str(i)];endfor i = 1:N idClass = classVec(i); plot(X(:,i), 'color', colors(idClass,:)) x = floor(ndata/2); y = 1- (i-1)/N; text(x, y, int2str(i), 'color', colors(idClass,:), 'VerticalAlignment', 'top',... 'HorizontalAlignment','center','FontSize',8)endlegend(Legend, 'Location', 'Southeast');With this code I got like shown
in which I got color repeated for different classes but I want each class with assigned colors. Could you please help me in this regard. Thanks
Best Answer