Consider the following code:
A=0:0.1:4;
for i=1:50,
B(:,i) = sin(A+i*0.01); % each column of B contains "shifted" sin
end
bar3(B); % plot such as each "shifted" sin will have different color
rr=1:size(B,1); % numbers to label different "shifted" sin in legend
l=strtrim(cellstr(num2str(rr'))') % converting numerical labels to strings accepted by "label"
legend(l);
How to display legend entries only for selected profiles e.g. 1st, 25th and last?
Question is similar to: How to show legend for only a specific subset of curves in the plotting? But I do not know how to get the figure handles for bar3 as suggested in the answer. Alternatively: does more elegant solution exist?