I have been trying to fix this issue for quite a while now. I've made a plot that has four graphs, and I added a legend so that the graphs could be easily understood. The problem is the color of the graphs doesn't match with the legend. I've shared the code below, and the picture of plots in attachment. What am I doing wrong?
box off, grid on
title("First four harmonics of y_a(t)");
legend('Zeroth Harmonic', 'First Harmonic', 'Second Harmonic', 'Third Harmonic');