MATLAB: One last question about plotting cell array

plot

So I get that I can have my data arranged like:
x1, y1, linespec1, x2, y2, linespec2, etc…
What about creating a legend? Can I add in the legend string after linespec?

Best Answer

No. The standard linespec strings are the only per-line properties you can set in a single plot() call. You will have to use the plot() form that returns the lineseries handles and set() the DisplayName property of each handle.