One combined legend entry for multiple plots
问题 For some reason, I would like to plot the line and marker of the same data separately. data1 = (1:1:10)'; data2 = (1:2:10); figure(1); plot(data1,data1,'or'); hold on; plot(data2,data2,'-r'); legend('data'); However it will only display the legend for the first plot. And Matlab seems not to have option to manipulate the legend marker, color and linestyle. How can I make legend like this? Thanks! 回答1: You will need to plot an invisible third plot (with almost no data to keep it fast) to define