How to change the curves to same colour when using hold on
조회 수: 12 (최근 30일)
이전 댓글 표시
Dear all, I am using a for-loop and hold on to plot a graph. As usual, Matlab automatically change the colour of legends but I want to keep all the legends in the same colour. Could you please help Thanks
댓글 수: 0
채택된 답변
Star Strider
2016년 5월 19일
Specify the colours in each plot call:
figure(1)
plot(x(1,:), y(1,:), '-k')
hold on
for k1 = 2:N
plot(x(k1,:), y(k1,:), '-k')
end
hold off
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!