When I execute the following code,
plot(1:10,sin(1:10),'r');hold onplot(1:10,cos(1:10),'r');plot(1:10,sin(1:10) + sin(1:10),'b');
a figure with three line plots appears. Two of the line plots are colored red and the other is colored blue. When I insert a legend in my figure, I observe two red lines labeled 'data1' and 'data2' and the blue line labeled 'data3' in the legend box. However, I wish to see only one entry for red line labeled as 'data1' and the blue line to be labeled 'data2'. How can I suppress legends with duplicate symbolization?
Best Answer