I like to plot two groups of lines in the same plot. Each group has two lines with same color and I have to draw them in the order of one group after another group. I try to
You can stitch multiple lines together using NaN, which means "pick up the pen". Then the legend will treat each as a single set of data.
hold on
plot([x1 NaN x2], [y1 NaN y2], 'b');
plot([x3 NaN x4], [y3 NaN y4], 'r');
legend({'foo', 'bar'})
hold off
For convenience, you can stick this in the multi-line version of plot.
plot([x1 NaN x2], [y1 NaN y2], 'b', [x3 NaN x4], [y3 NaN y4], 'r');
This could let you set() properties for the grouped lines as units, too.