Update Legend with varying values (variables) part2
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I have a hard time to figure this configuration out. This time a little bit more precise:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/327056/image.png)
Legend should look like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/327059/image.jpeg)
Tricky?
댓글 수: 2
Walter Roberson
2020년 7월 4일
Your legend(sprintf('curve%d',n)) does not appear to be within the loop?
And if it is, then so is the legend('unit cell')
채택된 답변
Nikhil Sonavane
2020년 7월 14일
As Walter suggested, your legend command should be in a loop to recurrsively update the legend in your figure. Variable Tpc_22 appears in the loop but only its last value is considered by the legend command while including legend in your figure. I would suggest you to use the legend command in the loop as well.
댓글 수: 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!