The following lines of code is just a simple use of legend function.
x = linspace(0,2*pi,360);y = sin(x);plot(x,y);legend('sin(x)');
But the result I get in my computer is incomplete: the legend dose not show the line of the curve.
I run the code in mac and it doesn't have this issue. My system is windows 10 and the version of matlab is R2019b. I don't know what causes this problem and hope someone can help me figure it out.
Best Answer