With the code below. This the example code from https://www.mathworks.com/help/matlab/ref/legend.html
x = linspace(0,pi);y1 = cos(x);plot(x,y1)hold on y2 = cos(2*x);plot(x,y2)legend('cos(x)','cos(2x)')
I got
The legend looks like this, which I can not understand.
If you check the last question I raised. All my figures have some problems with the legend. I do not know why. It seems that I need to change some settings of the matlab. The 2019b and 2020a both have this legend problem.
It looks like a very basic question. But it really annoys me for some time.
Any help, many thanks!
Best Answer