when i use the legend command , it works except the colors of the lines,they're the same color ?
이전 댓글 표시
I plotted 2 lines in different colors in the same figure by hold on, then made a legend
legend('Infinite sum','Finite sum') the legend is created but the color of the lines inside it are the same,instead of being different !
댓글 수: 1
Azzi Abdelmalek
2013년 6월 18일
post your code ( just lines using plot)
답변 (1개)
Shashank Prasanna
2013년 6월 18일
If your lines are of the same color then the legend will show the same color. If you plot using different colors, then legend will show them with those colors.
plot(rand(10,1))
hold on
plot(rand(10,1),'r')
legend('a','b')
What does the above piece of code show? are you able to see two different legend colors?
카테고리
도움말 센터 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!