The "legend" function appears to show unexpected behavior when plotting. Consider the following code snippet:
>> a=1:10;
>> b=2*(1:10)
>> c=3;
>> p1=plot(a,c,'ro');hold on;
>> p2=plot(a,b);
>> legend('a','b')
The above code generates the following figure:
In the above plot the legends seem to be incorrect. I would expect the legend 'b' to correspond to the line and not the marker
Best Answer