Change Legend diagram in matlab
问题 I have some code that basically does this: for i = 1:length(ReliabilityStruct) if (FailureFlags(i) == 0) plot(X(i), Y(i), '.b'); elseif (FailureFlags(i) == 1) plot(X(i), Y(i), 'or'); elseif (FailureFlags(i) == 2) plot(X(i), Y(i), 'og'); elseif (FailureFlags(i) == 3) plot(X(i), Y(i), 'ok'); else fprintf('\nUnknown Flag, check Data\n') return end end drawnow; legend('Recovery', '1', '2', '3'); So my aim is to make a graph that has different symbols for different flags. See below: As you can see