문제

I have several plots in a MATLAB code. But handling the legend colors each time is painful. Is there a way to name plots such as plot1=... and then using this name attaina color to a corresponding legend?

도움이 되었습니까?

해결책

Yes:

plot1 = plot(x,y);
legend(plot1, 'series 1', 'series 2');

plot1 is called the figure handle

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top